Skip to content

Instantly share code, notes, and snippets.

@tav
Created October 7, 2011 08:32
Show Gist options
  • Save tav/1269778 to your computer and use it in GitHub Desktop.
Save tav/1269778 to your computer and use it in GitHub Desktop.
# Inside the root of the Go repository...
from commands import getoutput
version = "%s %s\n" % (
getoutput(
'git describe --tags --abbrev=0 --match '
'"[wr]e[el][ke][la][ys][e.][2.][02r][0-9]*"'
),
getoutput("git describe --always --abbrev=8 --dirty=+")
)
version_file = open('VERSION', 'w')
version_file.write(version)
version_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment