Skip to content

Instantly share code, notes, and snippets.

@bumaociyuan

bumaociyuan/revision.sh

Forked from elmodos/revision.sh
Last active Feb 19, 2016
Embed
What would you like to do?
Xcode build number Git revision number
# get GIT revision number
buildNumber=`git rev-list --count HEAD`
# write build number
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${INFOPLIST_FILE}"
# if [ "$CONFIGURATION" == "Release" ]; then
# # version number like this V0.20160109.004
# # read current version number
# versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")
# # split version number by delimiter
# IFS='.' read -a array <<< "$versionNumber"
# n0=${array[0]}
# n1=${array[1]}
# n2=${array[2]}
# archiveNumer=$((n2+1))
# # write version number
# /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $n0.$n1.$archiveNumer" "${INFOPLIST_FILE}"
# fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment