Created
January 28, 2018 11:58
-
-
Save bananafish911/3a52880b4a79ca8e0675e33b602a4758 to your computer and use it in GitHub Desktop.
[CFBundleVersion]++ when installing
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
if [ $CONFIGURATION == Release ]; then | |
echo "Bumping build number..." | |
plist=${PROJECT_DIR}/${INFOPLIST_FILE} | |
# increment the build number (ie 115 to 116) | |
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}") | |
if [[ "${buildnum}" == "" ]]; then | |
echo "No build number in $plist" | |
exit 2 | |
fi | |
buildnum=$(expr $buildnum + 1) | |
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}" | |
echo "Bumped build number to $buildnum" | |
else | |
echo $CONFIGURATION " build - Not bumping build number." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment