Created
August 10, 2017 07:33
-
-
Save lexrus/ba597b140697f02868127c0f78142a60 to your computer and use it in GitHub Desktop.
Update version string in Settings.bundle
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
#!/bin/bash | |
PLISTBUDDY="/usr/libexec/PlistBuddy" | |
INFO_PLIST="$CODESIGNING_FOLDER_PATH/Info.plist" | |
SETTINGS_PLIST="$CODESIGNING_FOLDER_PATH/Settings.bundle/Root.plist" | |
VERSION_NUMBER="`$PLISTBUDDY -c \"Print CFBundleShortVersionString\" \"$INFO_PLIST\"`" | |
BUILD_NUMBER="`$PLISTBUDDY -c \"Print CFBundleVersion\" \"$INFO_PLIST\"`" | |
VERSION="Version $VERSION_NUMBER ($BUILD_NUMBER)" | |
GROUP_INDEX="`xmllint --xpath \"count(//array/dict)-1\" \"$SETTINGS_PLIST\"`" | |
$PLISTBUDDY -c "Set :PreferenceSpecifiers:$GROUP_INDEX:Title '$VERSION'" "$SETTINGS_PLIST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment