Last active
August 6, 2020 21:01
-
-
Save michaelnisi/ba3ab93bf1c984135f4875a08d7f96bc to your computer and use it in GitHub Desktop.
Updating the version number in a iOS 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
#!/usr/bin/env bash | |
set -o xtrace | |
SOURCE="${BASH_SOURCE[0]}" | |
if [[ -h $SOURCE ]]; then | |
SOURCE="$( readlink "$SOURCE" )" | |
fi | |
SOURCE_ROOT="${SOURCE_ROOT:-$( cd -P "$( dirname "$SOURCE" )/.." && pwd )}" | |
PLISTBUDDY=/usr/libexec/PlistBuddy | |
INFO_PLIST="$SOURCE_ROOT/Podest/Info.plist" | |
SETTINGS_PLIST="$SOURCE_ROOT/Settings.bundle/Root.plist" | |
VERSION_NUMBER="$($PLISTBUDDY -c 'Print CFBundleShortVersionString' $INFO_PLIST)" | |
BUILD_NUMBER="$($PLISTBUDDY -c 'Print CFBundleVersion' $INFO_PLIST)" | |
VERSION="$VERSION_NUMBER ($BUILD_NUMBER)" | |
$PLISTBUDDY -c "Set :PreferenceSpecifiers:0:DefaultValue $VERSION" $SETTINGS_PLIST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment