Created
January 1, 2014 10:16
-
-
Save alexrozanski/8206681 to your computer and use it in GitHub Desktop.
Shell script which gets the version of a particular target from its info plist file
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
targetName="..." | |
# Thanks to http://stackoverflow.com/a/13871762/75245 for help with the parsing. | |
relativeInfoPlistLocation=`/usr/bin/xcrun xcodebuild -showBuildSettings -target ${targetName} 2>/dev/null | grep "INFOPLIST_FILE" | sed 's/[ ]*INFOPLIST_FILE = //'` | |
absoluteInfoPlistLocation=${PROJECT_DIR}/$relativeInfoPlistLocation | |
version=`/usr/libexec/Plistbuddy -c 'Print :CFBundleShortVersionString' $absoluteInfoPlistLocation` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where does PROJECT_DIR get set?