Skip to content

Instantly share code, notes, and snippets.

@ajself
Created April 6, 2017 11:38
Show Gist options
  • Save ajself/d11ac10666eb03ae0dcbedf43745d825 to your computer and use it in GitHub Desktop.
Save ajself/d11ac10666eb03ae0dcbedf43745d825 to your computer and use it in GitHub Desktop.
Update build numbers
# Update build number with number of git commits
# adapted from http://blog.curtisherbert.com/automated-build-numbers/
buildNumber=$(git rev-list HEAD --count)
echo "Updating build number to $buildNumber"
dsym_plist="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
if [ -f "$DSYM_INFO_PLIST" ] ; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$dsymPlist"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment