Skip to content

Instantly share code, notes, and snippets.

@kaishin
Last active August 29, 2015 14:11
Show Gist options
  • Save kaishin/e330770ea21faba5e825 to your computer and use it in GitHub Desktop.
Save kaishin/e330770ea21faba5e825 to your computer and use it in GitHub Desktop.
GIT_RELEASE_VERSION=$(git describe --tags --always --abbrev=0)
COMMITS=$(git rev-list HEAD | wc -l)
COMMITS=$(($COMMITS+1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${COMMITS}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${GIT_RELEASE_VERSION#*v}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment