-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.ab
67 lines (52 loc) · 1.15 KB
/
compile.ab
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
64
65
66
67
import { exit } from "std/env"
fun build_to_client(){
echo "Building to client"
$ rm -rf ./dist $ failed {
echo "dist is not exist, ignore"
}
cd "client"
$ npm run build $ failed {
echo "Failed to build client"
// exit(1)
}
$ mv ./dist ../ $ failed {
echo "Failed to move dist"
exit(1)
}
cd "../"
}
fun build_to_server(){
echo "Building to server"
$ rm -r ./app $ failed {
echo "app is not exist, ignore"
}
$ GOOS=linux GOARCH=amd64 go build -o app $ failed {
echo "Failed to build server"
exit(1)
}
}
fun tar(){
echo "Tar to dist"
$ rm -r ./SgridCloudServer.tar.gz $ failed {
echo "SgridCloudServer.tar.gz is not exist, ignore"
}
$ tar -cvf SgridCloudServer.tar.gz ./app dist $ failed {
echo "Failed to tar"
exit(1)
}
echo "Tar Success"
}
fun clean(){
echo "Clean"
$ rm -r ./app $ failed {
echo "app is not exist, ignore"
}
$ rm -r ./dist $ failed {
echo "dist is not exist, ignore"
}
}
build_to_client()
build_to_server()
tar()
clean()
echo "Done"