forked from safing/portmaster-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack
executable file
·71 lines (64 loc) · 1.21 KB
/
pack
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
#!/bin/bash
baseDir="$( cd "$(dirname "$0")" && pwd )"
cd "$baseDir"
COL_OFF="\033[0m"
COL_BOLD="\033[01;01m"
COL_RED="\033[31m"
COL_GREEN="\033[32m"
COL_YELLOW="\033[33m"
function safe_execute {
echo -e "\n[....] $*"
$*
if [[ $? -eq 0 ]]; then
echo -e "[${COL_GREEN} OK ${COL_OFF}] $*"
else
echo -e "[${COL_RED}FAIL${COL_OFF}] $*" >/dev/stderr
echo -e "[${COL_RED}CRIT${COL_OFF}] ABORTING..." >/dev/stderr
exit 1
fi
}
function check {
# ./app/pack check
./app-electron/pack check
./notifier/pack check
./modules/pack check
./assets/pack check
}
function build {
# safe_execute ./app/pack build
safe_execute ./app-electron/pack build
safe_execute ./notifier/pack build
safe_execute ./modules/pack build
safe_execute ./assets/pack build
}
function reset {
# ./app/pack reset
./app-electron/pack reset
./notifier/pack reset
./modules/pack reset
./assets/pack reset
}
case $1 in
"check" )
check
;;
"build" )
build
;;
"reset" )
reset
;;
* )
echo ""
echo "build list:"
echo ""
check
echo ""
read -p "press [Enter] to start building" x
echo ""
build
echo ""
echo "finished building."
echo ""
;;
esac