-
Notifications
You must be signed in to change notification settings - Fork 118
/
run.sh
executable file
·73 lines (67 loc) · 1.43 KB
/
run.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
#!/usr/bin/env bash
# Environment
getSystemInfo() {
arch=$(uname -m)
case $arch in
armv7*) arch="arm";;
aarch64) arch="arm64";;
x86_64) arch="amd64";;
esac
os=$(echo `uname`|tr '[:upper:]' '[:lower:]')
}
getSystemInfo
topdir=$PWD
version=v$(cat VERSION)
# Options
help_message=$(cat <<-END
Usage:
run.sh -h
Print this help message.
run.sh -a [action]
Perform an action.
run.sh
Perform an action interactively.
Available actions:
build
Build the KCL package.
release
Create a releasing for the KCL package.
END
)
action=
while getopts "a:h:s:" opt; do
case $opt in
a)
action="$OPTARG"
;;
h)
echo "$help_message"
exit 1
;;
s)
sslpath="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG"
;;
esac
done
if [ "$action" == "" ]; then
PS3='Please select the action: '
options=("build" "release")
select action in "${options[@]}"
do
case $action in
"build")
break
;;
"release")
break
;;
*) echo "Invalid action $REPLY:$action"
exit 1
break
;;
esac
done
fi
topdir=$topdir version=$version sslpath=$sslpath $topdir/scripts/$action.sh