mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-22 07:57:31 +00:00
27 lines
568 B
Bash
Executable File
27 lines
568 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
|
|
IMPRINT="-X yggdrasil.buildName=$(sh contrib/semver/name.sh) -X yggdrasil.buildVersion=$(sh contrib/semver/version.sh)"
|
|
if [ $DEBUG ]; then
|
|
go build -ldflags="$IMPRINT" -tags debug -v $file
|
|
else
|
|
go build -ldflags="$IMPRINT -s -w" -v $file
|
|
fi
|
|
if [ $UPX ]; then
|
|
upx --brute ${file%.go}
|
|
fi
|
|
done
|