Created
May 6, 2011 07:50
-
-
Save vhbit/958578 to your computer and use it in GitHub Desktop.
Git versioning for iOS project sample
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
version=`git describe --long` | |
commit=`echo $version | sed 's#.*g\([a-z0-9]\{7\}\)#\1#'` | |
version=`echo $version | sed 's#[a-zA-Z]*##'` | |
versionNum=`echo $version | sed 's#\-[0-9]*\-[a-zA-Z0-9]*##'` | |
echo "#define BUILD_VERSION $version" > InfoPlist.h | |
echo "#define PRODUCT_VERSION $versionNum" >> InfoPlist.h | |
echo "#define GIT_COMMIT $commit" >> InfoPlist.h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment