mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 16:30:27 +00:00
Merge pull request #233 from neilalexander/build
Allow specifying PKGSRC=, PKGVER= and PKGNAME= to build script
This commit is contained in:
commit
43993a3460
7
build
7
build
@ -1,5 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/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
|
do
|
||||||
case "${option}"
|
case "${option}"
|
||||||
in
|
in
|
||||||
@ -10,7 +13,7 @@ done
|
|||||||
echo "Downloading..."
|
echo "Downloading..."
|
||||||
for CMD in `ls cmd/` ; do
|
for CMD in `ls cmd/` ; do
|
||||||
echo "Building: $CMD"
|
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
|
if [ $DEBUG ]; then
|
||||||
go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD
|
go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user