Skip to content

Instantly share code, notes, and snippets.

@wdecoster
Last active July 28, 2017 19:35
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 wdecoster/41147faa0a5f81907062bb6a37596a6a to your computer and use it in GitHub Desktop.
Save wdecoster/41147faa0a5f81907062bb6a37596a6a to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
import os
import sys
def main():
versionfile = [os.path.join(root, x) for root, dirs, files in os.walk(os.getcwd()) for x in files if x == "version.py"]
if len(versionfile) == 1:
with open(versionfile[0]) as versionf:
version = versionf.read().split("\"")[1]
os.system("git commit -m 'bumping version to {}' {}".format(version, versionfile[0]))
else:
sys.exit("Found multiple occurences of version.py - doing nothing.")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment