Created
February 26, 2017 10:41
Bump version in Info.plist
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
#!/bin/bash | |
component=$1 | |
version=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' Info.plist) | |
IFS="." read major minor patch <<< "$version" | |
echo "$version" | |
if [[ "$component" = 'major' ]]; then | |
major=$((major + 1)) | |
minor=0 | |
patch=0 | |
elif [[ "$component" = 'minor' ]]; then | |
minor=$((minor + 1)) | |
patch=0 | |
elif [[ "$component" = 'patch' ]]; then | |
patch=$((patch + 1)) | |
fi | |
version="${major}.${minor}.${patch}" | |
echo "$version" | |
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString ${version}" Info.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment