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
# Use the number of commits on the master git branch as build number. | |
# first, confirm git exists | |
hash git 2>/dev/null || { echo >&2 "Git required, not installed. Aborting build number update script."; exit 0; } | |
VERSION=$(git --git-dir="${PROJECT_DIR}/.git" --work-tree="${PROJECT_DIR}" rev-list master | wc -l) | |
# eventually this will be (number of commits)+1. Mixed opinion here. +1 on dev machine, but not on build/distr machine. | |
# VERSION=`expr $VERSION + 1` | |
echo "Build number is now $VERSION" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSION" ${INFOPLIST_FILE} |