Created
October 24, 2013 19:54
-
-
Save incanus/7143885 to your computer and use it in GitHub Desktop.
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
INFO=$( echo $TARGET_BUILD_DIR )/$( echo $INFOPLIST_PATH | sed -e 's/\.plist$//' ) | |
echo $INFO | |
TAG= | |
COMMIT= | |
CURRENT= | |
CURRENT_BUILD= | |
GITPATH=/usr/bin:/usr/local/bin:/usr/local/git/bin | |
PATH=$PATH:$GITPATH; export PATH | |
if [ -z $( which git ) ]; then | |
echo "Unable to find git binary in \$GITPATH" | |
exit 1 | |
fi | |
SHORT_VERSION=$( git describe --tags ) | |
VERSION=$( echo $SHORT_VERSION | sed -e 's/^v//' | sed -e 's/-/./' | sed -e 's/-.*//' ) | |
echo $VERSION | |
defaults write "$INFO" CFBundleShortVersionString $SHORT_VERSION | |
defaults write "$INFO" CFBundleVersion $VERSION | |
chmod 644 "$INFO.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This writes to the build app (OS X) bundle with some Git info as to the build number. Could be adapted for other uses / iOS use, I'll wager.