Last active
September 28, 2015 02:27
-
-
Save takatomo/fe5bb0ffbce51fc5c608 to your computer and use it in GitHub Desktop.
【ShellScript】Add Compatibility to XcodePlugins
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 | |
# 使用するときはここのパスを追加したいバージョンのXcodeのパスに変更してください。 | |
XCODE="/Applications/Xcode.app" | |
XCODE_ID=`find ${XCODE} -name Info.plist -maxdepth 2 | xargs -I{} defaults read {} DVTPlugInCompatibilityUUID` | |
PLUGINS=`find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3` | |
add_XcodeID() { | |
grep -c $1 "$2" >&/dev/null | |
if [ "$?" -ne "0" ]; then | |
defaults write "$2" DVTPlugInCompatibilityUUIDs -array-add ${XCODE_ID} | |
fi | |
} | |
export XCODE_ID | |
export -f add_XcodeID | |
echo "${PLUGINS}" | xargs -E\n -I{} bash -c 'add_XcodeID ${XCODE_ID} "{}";' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment