-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.sh
executable file
·63 lines (56 loc) · 1.6 KB
/
build.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
#!/usr/bin/env bash
set -e
function deployWeb() {
echo "building frontend assets with yarn"
(cd ./web/static/app && yarn install && yarn build)
echo "building godcr-web with packr2"
(cd ./cmd/godcr-web && packr2 build)
mv ./cmd/godcr-web/godcr-web ./godcr-web
echo "binary saved to ./godcr-web"
}
function buildFyne() {
echo "packing assets with packr2"
(cd fyne && packr2)
echo "building godcr-fyne with go build"
(cd ./cmd/godcr-fyne && go build)
mv ./cmd/godcr-fyne/godcr-fyne ./godcr-fyne
echo "binary saved to ./godcr-fyne"
}
function buildNuklear() {
echo "building with go build"
(cd ./cmd/godcr-nuklear && go build)
mv ./cmd/godcr-nuklear/godcr-nuklear ./godcr-nuklear
echo "binary saved to ./godcr-nuklear"
}
function buildTerminal() {
echo "building with go build"
(cd ./cmd/godcr-terminal && go build)
mv ./cmd/godcr-terminal/godcr-terminal ./godcr-terminal
echo "binary saved to ./godcr-terminal"
}
function buildCli() {
echo "building with go build"
(cd ./cmd/godcr-cli && go build)
mv ./cmd/godcr-cli/godcr-cli ./godcr-cli
echo "binary saved to ./godcr-cli"
}
interface=$1
if [[ "$interface" = "web" ]]; then
deployWeb
elif [[ "$interface" = "fyne" ]]; then
buildFyne
elif [[ "$interface" = "nuklear" ]]; then
buildNuklear
elif [[ "$interface" = "terminal" ]]; then
buildTerminal
elif [[ "$interface" = "cli" ]]; then
buildCli
elif [[ "$interface" = "all" ]]; then
buildCli
deployWeb
buildTerminal
buildFyne
buildNuklear
else
echo "Usage: ./build.sh {interface} e.g. ./build.sh web"
fi