Created
February 15, 2017 21:02
-
-
Save clburlison/da0827cbc685f0352231e11ed1af5827 to your computer and use it in GitHub Desktop.
Update the CFBundleVersion based off of your git commits.
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
# based on http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode | |
if git rev-parse --is-inside-work-tree 2> /dev/null > /dev/null; then | |
echo "Setting CFBundleVersion to Git rev-list --count" | |
build_number=$(git rev-list HEAD --count) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $build_number" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
else | |
echo "Not in a Git repo, not setting CFBundleVersion" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment