flokati/genversion.sh

13 lines
391 B
Bash
Executable File

#!/bin/sh
VERSIONGO="version/version.go"
echo "package version" >$VERSIONGO
echo "" >>$VERSIONGO
echo "const (" >>$VERSIONGO
echo -n " FlokatiVersion = \"" >>$VERSIONGO
echo -n `git rev-parse --abbrev-ref HEAD` >>$VERSIONGO
echo "\"" >>$VERSIONGO
echo -n " FlokatiBuild = \"" >>$VERSIONGO
echo -n `git rev-list HEAD --count` >>$VERSIONGO
echo "\"" >>$VERSIONGO
echo ")" >>$VERSIONGO