Skip to content

Instantly share code, notes, and snippets.

@jdg
Created July 14, 2010 20:36
Show Gist options
  • Save jdg/476028 to your computer and use it in GitHub Desktop.
Save jdg/476028 to your computer and use it in GitHub Desktop.
include git revision number in info.plist
#!/bin/bash
# Include commit rev script by @bsneed
buildPlist="${PRODUCT_NAME}-Info.plist"
buildCommit=$(/usr/local/git/bin/git --work-tree="${PROJECT_DIR}" show --abbrev-commit | grep "^commit")
/usr/libexec/PlistBuddy -c "Add :CFBundleCommit string $buildCommit" $buildPlist
if [ $? != 0 ]
then
/usr/libexec/PlistBuddy -c "Set :CFBundleCommit $buildCommit" $buildPlist
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment