mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-14 03:20:28 +00:00
c4d28c4f65
More portable way to strip the `.go` extension from files when packing with upx.
26 lines
417 B
Bash
Executable File
26 lines
417 B
Bash
Executable File
#!/bin/sh
|
|
while getopts ud option
|
|
do
|
|
case "${option}"
|
|
in
|
|
u) UPX=true;;
|
|
d) DEBUG=true;;
|
|
esac
|
|
done
|
|
export GOPATH=$PWD
|
|
echo "Downloading..."
|
|
go get -d -v
|
|
go get -d -v yggdrasil
|
|
for file in *.go ; do
|
|
echo "Building: $file"
|
|
#go build $@ $file
|
|
if [ $DEBUG ]; then
|
|
go build -tags debug -v $file
|
|
else
|
|
go build -ldflags="-s -w" -v $file
|
|
fi
|
|
if [ $UPX ]; then
|
|
upx --brute ${file%.go}
|
|
fi
|
|
done
|