Skip to content

Instantly share code, notes, and snippets.

@jjthrash
Created February 13, 2010 15:52
Show Gist options
  • Save jjthrash/303509 to your computer and use it in GitHub Desktop.
Save jjthrash/303509 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if [ -x /usr/local/bin/git ]; then
export GIT=/usr/local/bin/git
elif [ -x /usr/bin/git ]; then
export GIT=/usr/bin/git
else
exit 0
fi
export VERSION=`$GIT rev-parse HEAD`
echo Setting version number to 1.0-$VERSION
/usr/libexec/PlistBuddy "$TARGET_BUILD_DIR/$INFOPLIST_PATH" -c "Set CFBundleVersion 1.0-$VERSION"
plutil -convert binary1 "$TARGET_BUILD_DIR/$INFOPLIST_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment