Last active
December 30, 2015 17:39
-
-
Save rismay/7862740 to your computer and use it in GitHub Desktop.
This script bumps the version and build number every time you build and there has been a change to files in the build directory. The version and build numbers are the same. The Marketing Version is simply the build number / 100. The build number is displayed in Hex. To get this started: In your project settings put 0.00 in your version field and…
This file contains hidden or 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
#!/bin/bash | |
if [ -n "$(find "$PROJECT_DIR" \! -path "*xcuserdata*" \! -path "*.git" -newer "$INFOPLIST_FILE")" ]; then | |
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE") | |
versionNumber=`echo $versionNumber +0.01|bc` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" "$INFOPLIST_FILE" | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$((0x$buildNumber)) | |
buildNumber=$(($buildNumber + 1)) | |
buildNumber=$(printf "%X" $buildNumber) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment