-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·53 lines (44 loc) · 839 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
#!/usr/bin/env bash
lint() {
echo "Running linters..."
golangci-lint run ./...
}
build() {
build-gmiget
build-gmifmt
build-gmilinks
}
build-gmiget() {
echo "Building gmiget..."
go build -o bin/gmiget cmd/gmiget/main.go
}
build-gmifmt() {
echo "Building gmifmt..."
go build -o bin/gmifmt cmd/gmifmt/main.go
}
build-gmilinks() {
echo "Building gmilinks..."
go build -o bin/gmilinks cmd/gmilinks/main.go
}
test() {
echo "Running all tests..."
go test -test.count=1 -cover ./...
}
help() {
printf "%s <task> <args>\n" "$0"
printf "Tasks:\n"
compgen -A function | cat -n
}
die() {
printf "%s\n" "$@"
exit 1
}
action="$1"
case $action in
lint | build | build-gmiget | build-gmifmt | build-gmilinks | build-gmisrv | test | help)
"$@"
;;
*)
die "invalid action '${action}'"
;;
esac