Created
September 5, 2013 09:29
-
-
Save d-amend/6447960 to your computer and use it in GitHub Desktop.
Writes the CFBundleShortVersionString from the currently used Info.plist and the build number, generated from the git commit count to the Root.plist in a Settings.bundle
This file contains 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
# Get the commit count | |
GIT_COMMIT_COUNT=`git rev-list --all | wc -l | tr -d ' '` | |
#copy template to settingsbundle | |
bundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
#update Root.plist in settingsbundle with current version and build number | |
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $bundleVersion (build $GIT_COMMIT_COUNT)" "${PROJECT_DIR}"/Settings.bundle/Root.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment