forked from kcl-lang/kcl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·66 lines (62 loc) · 1.27 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
#!/usr/bin/env bash
# Environment
if [ -f "/etc/os-release" ]; then
source /etc/os-release
os=$ID
else
os=$(uname)
fi
topdir=$PWD
# 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
os=$os topdir=$topdir sslpath=$sslpath $topdir/scripts/$action.sh