-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sh
executable file
·41 lines (31 loc) · 735 Bytes
/
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
#!/bin/bash
if [ -z "$GOOS" ]; then
GOOS=linux
fi
if [ -z "$ARCH" ]; then
ARCH=amd64
fi
if ! [ -f .deps/prepared ]; then
mkdir .deps
curl -L https://golang.org/dl/go1.15.1.$GOOS-$ARCH.tar.gz > .deps/go.tar.gz
cd .deps/
tar -xvf go.tar.gz
cd -
touch .deps/prepared
fi
if [ -z "$BIN_OUTPUT" ]; then
BIN_OUTPUT=wireguard-go
fi
./.deps/go/bin/go build -v -o $BIN_OUTPUT || exit 1
cd guiwrapper
if [ -z "$GUIWRAPPER_BIN_OUTPUT" ]; then
GUIWRAPPER_BIN_OUTPUT=guiwrapper
fi
../.deps/go/bin/go build -v -o $GUIWRAPPER_BIN_OUTPUT || exit 1
cd ..
cd traywrapper
if [ -z "$TRAYWRAPPER_BIN_OUTPUT" ]; then
TRAYWRAPPER_BIN_OUTPUT=traywrapper
fi
../.deps/go/bin/go build -v -o $TRAYWRAPPER_BIN_OUTPUT || exit 1
cd ..