-
Notifications
You must be signed in to change notification settings - Fork 1
/
manageBuild.sh
executable file
·45 lines (43 loc) · 1021 Bytes
/
manageBuild.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
#!/bin/bash
function add {
echo "$1" >> .automation/forceList
}
function remove {
sed -i "/$1/d" .automation/forceList
}
function build {
readarray -t forces < .automation/forceList
#Write the core complier from template
sed -n -e "/#CORE/,/#END/w buildAll.sh" .automation/buildAll.template
#Write the force compilers from template
for var in "${forces[@]}"
do
echo "Writing ${var}"
echo "$(sed -n '/#FORCE/,/#END/p' .automation/buildAll.template)" >> buildAll.sh
sed -i -e "s;%NAME%;${var};g" buildAll.sh
done
#Write the UI compile from template
echo "$(sed -n '/#UI/,/#END/p' .automation/buildAll.template)" >> buildAll.sh
}
function display {
echo
cat < .automation/forceList
echo
}
while getopts "a:r:bc" OPTION
do
case $OPTION in
a)
add $OPTARG
;;
r)
remove $OPTARG
;;
b)
build
;;
c)
display
;;
esac
done