github.com/npaton/distribution@v2.3.1-rc.0+incompatible/version/version.sh (about) 1 #!/bin/sh 2 3 # This bash script outputs the current, desired content of version.go, using 4 # git describe. For best effect, pipe this to the target file. Generally, this 5 # only needs to updated for releases. The actual value of will be replaced 6 # during build time if the makefile is used. 7 8 set -e 9 10 cat <<EOF 11 package version 12 13 // Package is the overall, canonical project import path under which the 14 // package was built. 15 var Package = "$(go list)" 16 17 // Version indicates which version of the binary is running. This is set to 18 // the latest release tag by hand, always suffixed by "+unknown". During 19 // build, it will be replaced by the actual version. The value here will be 20 // used if the registry is run after a go get based install. 21 var Version = "$(git describe --match 'v[0-9]*' --dirty='.m' --always)+unknown" 22 EOF