Initial commit.
This commit is contained in:
13
build.sh
Executable file
13
build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION=$(git describe --tags --always 2>/dev/null)
|
||||
|
||||
if [ ! -z "$VERSION" ]; then
|
||||
echo "Building version: $VERSION"
|
||||
LDFLAGS="-ldflags \"-X main.Version=$VERSION\""
|
||||
else
|
||||
echo "Building without version information"
|
||||
LDFLAGS=""
|
||||
fi
|
||||
|
||||
go build $LDFLAGS -o test-version .
|
||||
Reference in New Issue
Block a user