-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
28 lines (23 loc) · 676 Bytes
/
build.sh
File metadata and controls
28 lines (23 loc) · 676 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
#!/bin/bash
if [ -d "build" ]; then
rm -rf "build"
fi
build_for_platform() {
GOOS=$1
GOARCH=$2
if [ "$GOARCH" == "arm" ]; then
HUMANARCH="arm"
elif [ "$GOARCH" == "386" ]; then
HUMANARCH="x86"
else
HUMANARCH="$GOARCH"
fi
echo "Building for $GOOS $HUMANARCH..."
GOOS=$GOOS
GOARCH=$GOARCH
go build -ldflags="-s -w -X main.isCLI=true" -o "build/$GOOS-$HUMANARCH/controlify_cli" controlify.go
go build -ldflags="-s -w" -o "build/$GOOS-$HUMANARCH/controlify_tray" controlify.go
cp config.json "build/$GOOS-$HUMANARCH/config.json"
}
build_for_platform "linux" "386"
build_for_platform "linux" "arm"