bbgo_origin/utils/generate-version-file.sh
2021-12-08 23:40:58 +08:00

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