-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·57 lines (47 loc) · 836 Bytes
/
build.sh
File metadata and controls
executable file
·57 lines (47 loc) · 836 Bytes
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
#!/bin/bash
BINARY_NAME="nturu"
INSTALL_PATH="/usr/local/bin"
build() {
go build -o "$BINARY_NAME"
}
install() {
build
sudo cp "$BINARY_NAME" "$INSTALL_PATH"
}
test_generate() {
install
echo "Running tests..."
./"$BINARY_NAME" generate
echo "Running tests... 2"
./"$BINARY_NAME" generate -framework fiber
echo "Tests passed successfully."
clean
uninstall
}
uninstall() {
sudo rm -f "$INSTALL_PATH/$BINARY_NAME"
}
clean() {
rm -f "$BINARY_NAME"
}
case "$1" in
build)
build
;;
install)
install
;;
test_generate)
test_generate
;;
uninstall)
uninstall
;;
clean)
clean
;;
*)
echo "Usage: $0 {build|install|test_generate|uninstall|clean}"
exit 1
esac
exit 0