Created
August 14, 2012 05:15
-
-
Save sonsongithub/3346502 to your computer and use it in GitHub Desktop.
Automatically update build number and github revision of Info.plist.
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
# update github revision | |
hash=$(git rev-parse HEAD) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleGithubRevision $hash" "$INFOPLIST_FILE" | |
shorthash=$(git rev-parse --short HEAD) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleGithubShortRevision $shorthash" "$INFOPLIST_FILE" | |
# update build number | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment