Created
October 27, 2018 08:23
-
-
Save danieltorrecillas/2ed0b957d225ef7cc9d82b2f0a1e4bb4 to your computer and use it in GitHub Desktop.
Increment CFBundleVersion (build) number from git
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
git=`sh /etc/profile; which git` | |
branch_name=`$git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,'` | |
git_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $git_count" "${PRODUCT_SETTINGS_PATH}" | |
echo "Updated build number in ${PRODUCT_SETTINGS_PATH} to $git_count from $branch_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment