gottdad/version.sh

13 lines
389 B
Bash
Raw Normal View History

2021-11-06 16:33:16 +01:00
# Get the version.
githash=`git rev-parse --short HEAD`
buildstamp=`date -u '+%Y-%m-%d_%H:%M:%S'`
commits=`git rev-list --count master`
# Write out the package.
cat << EOF > version.go
// Code generated by version.sh (@generated) DO NOT EDIT.
package main
var githash = "$githash"
var buildstamp = "$buildstamp"
var commits = "$commits"
var version = "$githash-b$commits - $buildstamp"
EOF