Last active
July 6, 2020 08:11
-
-
Save yhkaplan/c3d12584395152092a989b046975482e to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
PLIST_BUDDY="/usr/libexec/PlistBuddy" | |
INFO_PLIST_PATH="app/Info.plist" | |
CURRENT_FULL_VERSION=$("$PLIST_BUDDY" -c "Print CFBundleVersion" "$INFO_PLIST_PATH") | |
CURRENT_MARKETING_VERSION=$("$PLIST_BUDDY" -c "Print CFBundleShortVersionString" "$INFO_PLIST_PATH") | |
ALL_INFO_PLIST_FILES=$(git grep --files-with-matches "CFBundleVersion" -- "*Info.plist") | |
for INFO_PLIST_FILE in $ALL_INFO_PLIST_FILES; do | |
# Using this make weird diff: PlistBuddy -c "Set :CFBundleVersion 9.60.0.1" | |
echo "Setting $INFO_PLIST_FILE" | |
echo "Full version from $CURRENT_FULL_VERSION to $NEW_FULL_VERSION" | |
sed -i '' "s/$CURRENT_FULL_VERSION/$NEW_FULL_VERSION/g" "$INFO_PLIST_FILE" | |
echo "Marketing version from $CURRENT_MARKETING_VERSION to $NEW_MARKETING_VERSION" | |
echo | |
sed -i '' "s/$CURRENT_MARKETING_VERSION/$NEW_MARKETING_VERSION/g" "$INFO_PLIST_FILE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
NEW_MARKETING_VERSION="11.0.0" NEW_FULL_VERSION="11.0.0.3" ./bin/set_version.sh
This script is for when you can't use agvtool