forked from DeepIT/XcodeColors
-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathupdate_compat.sh
More file actions
executable file
·31 lines (26 loc) · 842 Bytes
/
update_compat.sh
File metadata and controls
executable file
·31 lines (26 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# show Xcode version and UUID
xcodebuild -version
for xc in Xcode Xcode-beta; do
app=/Applications/$xc.app
if [[ -e $app ]]; then
echo "Updating for $app"
uuid=$(defaults read $app/Contents/Info DVTPlugInCompatibilityUUID)
echo "UUID $uuid"
echo ""
# check UUID
plist=$(pwd)/XcodeColors/Info.plist
if [ -n "$(defaults read "$plist" | grep $uuid)" ] ; then
echo "UUID is already added to $plist"
continue
fi
# add UUID to .plist
echo "Add UUID to $plist"
defaults write "$plist" DVTPlugInCompatibilityUUIDs -array-add $uuid
fi
done
# The defaults tool will write a binary plist
# Convert it back to XML to make the diff's readable
plutil -convert xml1 "$plist"
# show the result
defaults read "$plist"