Created
March 12, 2015 16:28
-
-
Save neonichu/6cb139e870beb4974f0b to your computer and use it in GitHub Desktop.
Quickly bump the compatibility UUID of a plugin in the CWD to the one of the currently selected Xcode.
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/sh | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
function add_id { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $1" "$2" | |
} | |
function has_id { | |
read_id DVTPlugInCompatibilityUUIDs *Info.plist|grep -q "$1" | |
return $? | |
} | |
function read_id { | |
"$PLIST_BUDDY" -c "Print $1" "$2" | |
} | |
current_id=`read_id DVTPlugInCompatibilityUUID "$(xcode-select -p)/../Info.plist"` | |
if `has_id $current_id` | |
then | |
true | |
else | |
add_id $current_id *Info.plist | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment