Skip to content

Instantly share code, notes, and snippets.

@neonichu
Created March 12, 2015 16:28
Show Gist options
  • Save neonichu/6cb139e870beb4974f0b to your computer and use it in GitHub Desktop.
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.
#!/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