Created
March 21, 2012 20:16
-
-
Save krisalyssa/2152417 to your computer and use it in GitHub Desktop.
Script to turn Git version into plist preprocessor vars for Xcode
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
GIT=`which git` | |
BASE="HelloWorld/HelloWorld-Info" | |
PLIST="$BASE.plist" | |
PLIST_H="$BASE-plist.h" | |
touch $PLIST | |
VERSION=`$GIT describe --dirty | sed 's/[a-zA-Z]*//'` | |
SHORT_VERSION=`echo $VERSION | sed 's/\-[0-9]*\-[a-zA-Z0-9]*//'` | |
echo "#define GIT_VERSION $VERSION" > $PLIST_H | |
echo "#define APP_VERSION $SHORT_VERSION" >> $PLIST_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment