-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
55 lines (41 loc) · 771 Bytes
/
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
buildApp()
{
# clear the screen (the terminal)
clear
echo -e "building botBinary, please wait a bit..."
go build -o botBinary
}
runApp()
{
# clear the screen (the terminal)
clear
echo -e "we are done building it,\n->now running the botBinary...\n-------------------"
./botBinary
}
testApp()
{
# clear the screen (the terminal)
clear
echo -e "we are running all test files (*_test.go);\nplease wait a bit"
go test -v ./...
}
if [ "$1" == "test" ];
then
testApp;
exit 0
fi;
operations=0
if [ -z "$1" ] || [ "$1" == "true" ] || [ "$1" == "1" ];
then
buildApp;
operations=$((i+1))
fi;
if [ -z "$2" ] || [ "$2" == "true" ] || [ "$2" == "1" ];
then
runApp;
operations=$((i+1))
fi;
if [ $operations == 0 ]
then
echo "You have done nothing!"
fi;