-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·78 lines (59 loc) · 1.17 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
function main {
# loop args
if [[ $# -ne 0 ]] ; then
for var in "$@" ; do
eval $var
done
exit 1
fi
# menu
while true; do
read -n 1 -p "
config
===================
1) Run Release
2) Build Release
3) Build Debug
4) Run Debug
tools
===================
m) Modify SVG's
*) Any key to exit
:" ans;
reset
case $ans in
1) fn_run ;;
2) fn_build ;;
3) fn_build_debug ;;
4) fn_run_debug ;;
m) fn_mod_svg ;;
*) $SHELL ;;
esac
done
}
function fn_mod_svg {
for file in res/*.svg; do
echo $'\n'"$file"
# remove comments
sed -i 's/<!--.*-->//g' "$file"
# remove new lines space etc between tags
sed -i 's/>[[:space:]]*</></g' "$file"
done
}
function fn_run {
cp ./target/release/surfboard surfboard
./surfboard
}
function fn_build {
cargo build --release
cp ./target/release/surfboard surfboard
}
function fn_build_debug {
cargo build
}
function fn_run_debug {
./target/debug/surfboard
}
# pass all args
main "$@"