Last active
April 13, 2023 15:12
-
-
Save hishma/956f42274b96cda6af10b40d6594dcdb to your computer and use it in GitHub Desktop.
Shell script to update the build number (CFBundleVersion) of the info.plist in the build folder.
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
# Shamelessly ripped of from https://blog.curtisherbert.com/automated-xcode-build-numbers-early-2019-edition/ | |
# | |
git=`sh /etc/profile; which git` | |
bundleVersion=`"$git" rev-list --all | wc -l | tr -d '[:space:]'` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
echo "☛ BUILD NUMBER: ${bundleVersion}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My version trims the whitespace from the derived
bundleVersion
, and also outputs the build number in the build report.