-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.sh
executable file
·46 lines (40 loc) · 915 Bytes
/
make.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
#!/bin/bash
# Builds binary of pe-terminal
build() {
remove
echo "Building pe-terminal..."
if [[ -n "$1" && -n "$2" ]]; then
# Expected parameters GOOS=linux/mac/windows GOARCH=amd64/arm
env "$1" "$2" go build -v .
else
go build -v .
fi
}
# Starts pe-terminal with/without parameters
run() {
if [[ -n "$1" ]]; then
build "$@"
./pe-terminal "$1"
else
echo "No config-file provided, use flag -config=<filename>.json"
fi
}
# Runs all the unit tests
test() {
go vet
if [[ -n "$1" ]]; then
go test "$1" -timeout 15s github.com/PelionIoT/pe-terminal/components
else
go test -timeout 15s github.com/PelionIoT/pe-terminal/components
fi
}
# Removes binary of pe-terminal
remove() {
echo "Cleaning build-cache..."
rm -rf pe-terminal
}
# Displays binary info
describe() {
file pe-terminal
}
"$@"