Created
May 20, 2015 06:23
-
-
Save forbze/0212f00ec31f8a8d9b15 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
git=$(sh /etc/profile; which git) | |
git_release_version=$("$git" describe --tags --always --abbrev=0) | |
number_of_commits=$("$git" rev-list master | wc -l | tr -d ' ') | |
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH" | |
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist" | |
watch_plist="$TARGET_BUILD_DIR/Acara WatchKit App.app/Info.plist" | |
watch_appex_plist="$TARGET_BUILD_DIR/Acara WatchKit Extension.appex/Info.plist" | |
for plist in "$target_plist" "$dsym_plist" "$watch_appex_plist" "$watch_plist"; do | |
if [ -f "$plist" ]; then | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${git_release_version#*v}" "$plist" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment