Created
May 17, 2011 19:26
-
-
Save aggieben/977185 to your computer and use it in GitHub Desktop.
Xcode RunScript to insert git-ish version string into bundle version property in Info.plist
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
echo "majorMinor=`/usr/libexec/PlistBuddy -c \"Print :CFBundleVersion\" \"${PROJECT_DIR}/${PROJECT_NAME}-Info.plist\"`" | |
majorMinor=`/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "${PROJECT_DIR}/${PROJECT_NAME}-Info.plist"` | |
echo "build=`git describe --match ${majorMinor}* --tags --dirty=+ | sed \"s/\(${majorMinor}\)\(.*\)/\2/\"`" | |
build=`git describe --match ${majorMinor}* --tags --dirty=+ | sed "s/\(${majorMinor}\)\(.*\)/\2/"` | |
echo "/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion ${majorMinor}.${build}\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${majorMinor}.${build}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment