Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Commit

Permalink
Remove Alcatraz from the Xcode skipped plugins list at install
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumealgis committed Oct 23, 2015
1 parent 273f295 commit 514449c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ set -euo pipefail

DOWNLOAD_URI=https://github.com/supermarin/Alcatraz/releases/download/1.1.10/Alcatraz.tar.gz
PLUGINS_DIR="${HOME}/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
XCODE_VERSION="$(xcrun xcodebuild -version | head -n1 | awk '{ print $2 }')"
PLIST_PLUGINS_KEY="DVTPlugInManagerNonApplePlugIns-Xcode-${XCODE_VERSION}"
BUNDLE_ID="com.mneorr.Alcatraz"
TMP_FILE="/tmp/${BUNDLE_ID}.xcode-defaults"

# Remove Alcatraz from Xcode's skipped plugins list if needed
defaults read -app Xcode "$PLIST_PLUGINS_KEY" > "$TMP_FILE"
/usr/libexec/PlistBuddy -c "delete skipped:$BUNDLE_ID" "$TMP_FILE" > /dev/null 2>&1 && {
pgrep Xcode > /dev/null && { echo 'An instance of Xcode is currently running. Please close Xcode before installing Alcatraz.'; exit 1; }
defaults write -app Xcode "$PLIST_PLUGINS_KEY" "$(< $TMP_FILE)"
echo 'Alcatraz was removed from Xcode'\''s skipped plugins list. Next time you start Xcode select "Load Bundle" when prompted.'
}
rm "$TMP_FILE"

mkdir -p "${PLUGINS_DIR}"
curl -L $DOWNLOAD_URI | tar xvz -C "${PLUGINS_DIR}"
Expand Down

0 comments on commit 514449c

Please sign in to comment.