Suggest full path to Xcode 4.3 /Developer

Some people seem to have an older xcode-select even after installing the CLT from inside Xcode or otherwise. So this is works for both.

Now we aren't future-proofed in case Apple change the location, but hopefully they won't, seems unlikely.

Refs Homebrew/homebrew#10743. Fixes Homebrew/homebrew#10745.
This commit is contained in:
Max Howell 2012-03-07 15:08:29 +00:00
parent a396e5e720
commit 5b0d97efc7

View File

@ -349,6 +349,11 @@ def check_xcode_select_path
path = `xcode-select -print-path 2>/dev/null`.chomp path = `xcode-select -print-path 2>/dev/null`.chomp
unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild" unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild"
# won't guess at the path they should use because it's too hard to get right # won't guess at the path they should use because it's too hard to get right
# We specify /Applications/Xcode.app/Contents/Developer even though
# /Applications/Xcode.app should work because people don't install the new CLI
# tools and then it doesn't work. Lets hope the location doesn't change in the
# future.
<<-EOS.undent <<-EOS.undent
Your Xcode is configured with an invalid path. Your Xcode is configured with an invalid path.
You should change it to the correct path. Please note that there is no correct You should change it to the correct path. Please note that there is no correct
@ -357,7 +362,7 @@ def check_xcode_select_path
these is (probably) what you want: these is (probably) what you want:
sudo xcode-select -switch /Developer sudo xcode-select -switch /Developer
sudo xcode-select -switch /Applications/Xcode.app sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
EOS EOS
end end
end end