Skip to content

Instantly share code, notes, and snippets.

@krisalyssa
Created March 21, 2012 20:16
Show Gist options
  • Save krisalyssa/2152417 to your computer and use it in GitHub Desktop.
Save krisalyssa/2152417 to your computer and use it in GitHub Desktop.
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