Skip to content

Instantly share code, notes, and snippets.

@philipcristiano
Created December 9, 2014 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipcristiano/3d306c0fd054934152ad to your computer and use it in GitHub Desktop.
Save philipcristiano/3d306c0fd054934152ad to your computer and use it in GitHub Desktop.
Python semver from git tag for PBR
if git describe --exact-match 2> /dev/null; then
VERSION=$(git describe)
else
VERSION=$(git describe | sed -E 's/([0-9]+)\.([0-9]+)-([0-9]+).*/\1.\2.\3/')
git tag -a "$VERSION" -m "Tagging version \"${VERSION}\""
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment