2015-01-29 23:32:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This bash script outputs the current, desired content of version.go, using
|
|
|
|
# git describe. For best effect, pipe this to the target file. Generally, this
|
|
|
|
# only needs to updated for releases. The actual value of will be replaced
|
|
|
|
# during build time if the makefile is used.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
package version
|
|
|
|
|
|
|
|
// Package is the overall, canonical project import path under which the
|
|
|
|
// package was built.
|
|
|
|
var Package = "$(go list)"
|
|
|
|
|
|
|
|
// Version indicates which version of the binary is running. This is set to
|
|
|
|
// the latest release tag by hand, always suffixed by "+unknown". During
|
|
|
|
// build, it will be replaced by the actual version. The value here will be
|
2022-11-29 14:42:26 +00:00
|
|
|
// used if the registry is run after a go install based install.
|
2015-01-29 23:32:49 +00:00
|
|
|
var Version = "$(git describe --match 'v[0-9]*' --dirty='.m' --always)+unknown"
|
2018-08-01 22:37:21 +00:00
|
|
|
|
|
|
|
// Revision is filled with the VCS (e.g. git) revision being used to build
|
|
|
|
// the program at linking time.
|
|
|
|
var Revision = ""
|
|
|
|
EOF
|