Last active
August 29, 2015 14:18
-
-
Save iamcam/63d613a481b26f9e4e8b to your computer and use it in GitHub Desktop.
Automate iOS + WatchKit extension build numbers w/ Git
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
if [ ${CONFIGURATION} == "AppStore" ]; then | |
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ') | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit App/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit Extension/Info.plist" | |
fi; | |
if [ ${CONFIGURATION} == "Release" ]; then | |
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ') | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit App/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit Extension/Info.plist" | |
fi; | |
if [ ${CONFIGURATION} == "Debug" ]; then | |
buildNumber="Dev" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit App/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit Extension/Info.plist" | |
fi; |
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
buildNumber="Dev" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName/AppName-Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit App/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/AppName WatchKit Extension/Info.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment