Skip to content

Instantly share code, notes, and snippets.

@boxcar
Created July 14, 2010 20:36
Show Gist options
  • Save boxcar/476026 to your computer and use it in GitHub Desktop.
Save boxcar/476026 to your computer and use it in GitHub Desktop.
#!/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