Git and XCode: A git build number script


/ Published in: Python
Save to your folder(s)

The script was modified slightly based on comments.


Copy this code and paste it in your HTML
  1. import os
  2. from Foundation import NSMutableDictionary
  3.  
  4. version = os.popen4("git rev-parse --short HEAD")[1].read()
  5. info = os.environ['INFOPLIST_PATH']
  6.  
  7. plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info)
  8. plist['CFBundleVersion'] = version
  9. plist.writeToFile_atomically_(info, 1)

URL: http://www.cimgf.com/2008/04/13/git-and-xcode-a-git-build-number-script/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.