Created
June 23, 2009 14:17
-
-
Save mkhl/134552 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU -rubygems | |
# http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/ | |
# I saw the script from the above URL and thought it was unnecessarily complicated. | |
# So I uncomplicated it. | |
require 'osx/plist' | |
File.open(File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH']), 'r+') do |io| | |
plist, format = OSX::PropertyList.load(io, true) | |
io.rewind | |
plist['CFBundleVersion'] = "#{plist['CFBundleVersion'].sub(/\s+\(git sha \w+\)$/, '')} (git sha #{`git rev-parse --short HEAD`.chomp})" | |
OSX::PropertyList.dump(io, plist, format) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment