Return to Snippet

Revision: 8294
at October 10, 2008 00:25 by sudarkoff


Updated Code
import os
from Foundation import NSMutableDictionary

version = os.popen4("git rev-parse --short HEAD")[1].read()
info = os.environ['INFOPLIST_PATH']

plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info)
plist['CFBundleVersion'] = version
plist.writeToFile_atomically_(info, 1)

Revision: 8293
at September 11, 2008 14:05 by sudarkoff


Initial Code
import os
from Foundation import NSMutableDictionary

version = os.popen4("git rev-parse –short HEAD")[1].read()
info = os.environ['INFOPLIST_PATH']

plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info)
plist['CFBundleVersion'] = version
plist.writeToFile_atomically_(info, 1)

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

Initial Description
The script was modified slightly based on comments.

Initial Title
Git and XCode: A git build number script

Initial Tags
python, git

Initial Language
Python