From c32d99ea6544c77e0e06c1e05d486dbc3d5aa9ce Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Fri, 19 Feb 2021 19:27:17 +0500 Subject: [PATCH] Ability to overwrite go binary path when building. Fixes #9. --- scripts/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build.sh b/scripts/build.sh index f848b0b..683c8e6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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}