Ability to overwrite go binary path when building.

Fixes #9.
This commit is contained in:
Stanislav Nikitin 2021-02-19 19:27:17 +05:00
parent edfbd5a90d
commit c32d99ea65
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550

View File

@ -2,6 +2,8 @@
# Metricator build script.
GO=${GO:=$(which go)}
source ./scripts/shell_helpers/get_git_data.sh
WHATTOBUILD=$1
@ -13,5 +15,7 @@ LINKERFLAGS="\
-X go.dev.pztrn.name/metricator/internal/common.Version=${VERSION}"
echo "Using $(go version) at ${GO}"
cd cmd/${WHATTOBUILD}
go build -tags netgo -ldflags "${LINKERFLAGS} -w -extldflags '-static'" -o ../../._bin/${WHATTOBUILD}