Skip to content

Commit

Permalink
xcode-toggle recognize CLI Tools Install Path
Browse files Browse the repository at this point in the history
  • Loading branch information
fbartho committed Nov 15, 2021
1 parent 93a83d0 commit c79910b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/xcode-toggle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
ALT_XCODE_NAME="13-beta4"
ALT_XCODE_GREP="13-beta4"

`xcode-select -p | grep -i $ALT_XCODE_GREP > /dev/null`
current_path=`xcode-select -p`
if [ current_path == "/Library/Developer/CommandLineTools" ]; then
echo "CommandLineTools selected. Switching to release."
sudo xcode-select -s /Applications/Xcode.app
exit 0
fi

`echo "$current_path" | grep -i $ALT_XCODE_GREP > /dev/null`
if [ $? -eq 0 ]
then
echo "Using Xcode$ALT_XCODE_NAME. Switching to release."
Expand Down

0 comments on commit c79910b

Please sign in to comment.