bbgo_origin/utils/generate-version-file.sh
2021-12-07 14:35:00 +08:00

20 lines
275 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
cat <<END
// +build release
package $PACKAGE_NAME
const Version = "${VERSION}"
const VersionGitRef = "${REF}"
END