add platform spec to build path;echo version to console

This commit is contained in:
Greg Gauthier 2021-03-19 08:45:56 +00:00
parent 44080ebac9
commit 758d317d0f

View File

@ -3,7 +3,6 @@
GOPATH=$HOME/go
GOPATH=$GOPATH:$(pwd)
export GOPATH
echo $GOPATH
GIT_COMMIT=$(git rev-list -1 HEAD)
export GIT_COMMIT
@ -12,7 +11,11 @@ export CANONICAL_VERSION
VERSION_STRING="$CANONICAL_VERSION-$GIT_COMMIT"
export VERSION_STRING
buildpath="build/$(uname)/gostations"
go mod vendor
go mod tidy
go build -o build/gostations -ldflags "-X main.version=$VERSION_STRING"
go build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
"$buildpath" -v