Created
April 11, 2015 19:50
-
-
Save alexlee002/b87dbeac1f9fd896174b to your computer and use it in GitHub Desktop.
Auto update Xcode plugins to support new version of Xcode
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/sh | |
PLUGINS_DIR="$HOME/Library/Application Support/Developer/Shared/Xcode/Plug-ins" | |
XCODE_INFO_PATH=$(xcode-select -p) | |
XCODE_INFO_PATH=$(dirname "$XCODE_INFO_PATH")/Info | |
DVTPlugInCompatibilityUUID=$(defaults read "$XCODE_INFO_PATH" DVTPlugInCompatibilityUUID) | |
for plugin in "$PLUGINS_DIR"/*.xcplugin; do | |
plugin_info_path="$plugin/Contents/Info" | |
if [[ -f "$plugin_info_path.plist" ]]; then | |
count=$(defaults read "$plugin_info_path" DVTPlugInCompatibilityUUIDs | grep $DVTPlugInCompatibilityUUID | wc -l) | |
if [[ $count -eq 0 ]]; then | |
echo "add compatibility UUID to \033[31m$(basename "$plugin")\033[0m" | |
defaults write "$plugin_info_path" DVTPlugInCompatibilityUUIDs -array-add $DVTPlugInCompatibilityUUID | |
fi | |
fi | |
done | |
echo "Done! please restart your Xcode~" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment