From 0fdc814c4ac7bae91b7d1a8868ac41f281ce882b Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 9 Dec 2018 14:32:24 +0000 Subject: [PATCH] Allow specifying PKGSRC=, PKGVER= and PKGNAME= to build script --- build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build b/build index 8dd23ef4..5f13f844 100755 --- a/build +++ b/build @@ -1,5 +1,8 @@ #!/bin/sh -while getopts ud option +PKGSRC=${PKGSRC:-github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil} +PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)} +PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)} +while getopts "ud" option do case "${option}" in @@ -10,7 +13,7 @@ done echo "Downloading..." for CMD in `ls cmd/` ; do echo "Building: $CMD" - IMPRINT="-X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildName=$(sh contrib/semver/name.sh) -X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildVersion=$(sh contrib/semver/version.sh --bare)" + IMPRINT="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER" if [ $DEBUG ]; then go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD else