Skip to content

Instantly share code, notes, and snippets.

@funky-monkey
Last active September 23, 2015 13:20
Show Gist options
  • Save funky-monkey/4b930432bab530a23bfb to your computer and use it in GitHub Desktop.
Save funky-monkey/4b930432bab530a23bfb to your computer and use it in GitHub Desktop.
Updating Settings.bundle/Root.plist with version information. Don't forget to update the name of your App-Info.plist
GIT_COMMIT_NUM=`git log --pretty=format:'' | wc -l | tr -d ' '`
SPRINT_VERSION=`/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' 'App-Info.plist'`
echo "Updating the build number: $GIT_COMMIT_NUM"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GIT_COMMIT_NUM" "App-Info.plistt"
echo "Updating the version in Settings.plist: $SPRINT_VERSION"
echo "Updating the build in Settings.plist: $GIT_COMMIT_NUM"
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $SPRINT_VERSION" "Settings/Settings.bundle/Root.plist"
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $GIT_COMMIT_NUM" "Settings/Settings.bundle/Root.plist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment