-
Notifications
You must be signed in to change notification settings - Fork 0
/
aiken.sh
executable file
·46 lines (40 loc) · 1.11 KB
/
aiken.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
PROJECT=$(pwd | rev | cut -d '/' -f1 | rev)
MAGENTA='\033[1;35m'
WHITE='\033[1;37m'
RESET='\033[0m'
# aiken format
aiken fmt
# aiken check
echo -e "${MAGENTA}Running${RESET} ${WHITE}aiken check${RESET}:"
aiken c 2>&1 | tee ${PROJECT}.tests
echo "" # new line
# aiken build
echo -e "${MAGENTA}Running${RESET} ${WHITE}aiken build${RESET}:"
aiken b $1
echo "" # new line
# aiken blueprint & address
echo -e "${MAGENTA}Running${RESET} ${WHITE}aiken blueprint${RESET} & ${WHITE}aiken address${RESET}:"
aiken blueprint convert > ${PROJECT}.plutus
aiken address > ${PROJECT}.address
echo "" # new line
# aiken docs
if [ $# -eq 0 ]; then
echo -e "${MAGENTA}Running${RESET} ${WHITE}aiken docs${RESET}:"
aiken docs
fi
# .gitignore
GITIGNORE=()
GITIGNORE+=("*.tests")
GITIGNORE+=("*.plutus")
GITIGNORE+=("*.address")
while read LINE; do
if [ "$LINE" == "docs/" ]; then
GITIGNORE+=("# docs/")
elif [ "$LINE" != "*.tests" ] &&
[ "$LINE" != "*.plutus" ] &&
[ "$LINE" != "*.address" ]; then
GITIGNORE+=("$LINE")
fi
done < .gitignore
printf "%s\n" "${GITIGNORE[@]}" > .gitignore