gocw2/version.sh
2021-10-27 09:28:45 +08:00

13 lines
341 B
Bash

# 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"
EOF