Get version information from git tag

This commit is contained in:
Tobie Morgan Hitchcock 2019-12-08 13:53:06 +00:00
parent 19635d98e4
commit d103269a62
2 changed files with 4 additions and 3 deletions

View file

@ -5,4 +5,5 @@ set -eu
cd "$(dirname "${0}")/.."
echo '-X "github.com/abcum/surreal/util/build.rev='$(git rev-parse HEAD)'"' \
'-X "github.com/abcum/surreal/util/build.ver='$(git describe --tags --abbrev=0 || echo 0.0.0)'"' \
'-X "github.com/abcum/surreal/util/build.time='$(date -u '+%Y/%m/%d %H:%M:%S')'"'

View file

@ -19,9 +19,9 @@ import (
)
var (
ver = "0.1.0" // Version number
rev string // Git revision of this build
time string // Build time in UTC (year/month/day hour:min:sec)
ver string // Version number
rev string // Git revision of this build
time string // Build time in UTC (year/month/day hour:min:sec)
)
// Info holds information about the current build