mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
24 lines
354 B
Bash
Executable File
24 lines
354 B
Bash
Executable File
#!/bin/bash
|
|
PACKAGE_NAME=version
|
|
REF=$(git show -s --format=%h -1)
|
|
VERSION=$VERSION-$REF
|
|
|
|
if [[ -z $VERSION ]] ; then
|
|
VERSION=$(git describe --tags)
|
|
fi
|
|
|
|
if [[ -n $VERSION_SUFFIX ]] ; then
|
|
VERSION=${VERSION}${VERSION_SUFFIX}
|
|
fi
|
|
|
|
cat <<END
|
|
// +build release
|
|
|
|
package $PACKAGE_NAME
|
|
|
|
const Version = "${VERSION}"
|
|
|
|
const VersionGitRef = "${REF}"
|
|
|
|
END
|