Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script to turn Git version into plist preprocessor vars for Xcode
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