diff options
| author | Max Howell | 2012-03-01 10:19:43 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-01 10:19:55 +0000 |
| commit | abe0be8a2e7ae2a84f5bae859bce0f0faf7008b1 (patch) | |
| tree | 574411df3e4a019e7f81105718d5f64b76a1eb02 /Library | |
| parent | e6f8f1618388d705883e943b1c4b6aff8e409b1a (diff) | |
| download | brew-abe0be8a2e7ae2a84f5bae859bce0f0faf7008b1.tar.bz2 | |
Show doctor error if xcode-select path is invalid
Fixes Homebrew/homebrew#10598.
Ideally we would show a message for builds that use xcodebuild etc. But there is no easy mechanism for this in place.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index c3d20d013..afe306ecc 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -356,6 +356,24 @@ def check_xcode_prefix end end +def check_xcode_select_path + path = `xcode-select -print-path 2>/dev/null`.chomp + 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 + ohai "Your Xcode is configured with an invalid path." + puts <<-EOS.undent + You should change it to the correct path. Please note that there is no correct + path at this time if you have *only* installed the Command Line Tools for Xcode. + If your Xcode is pre-4.3 or you installed the whole of Xcode 4.3 then one of + these is (probably) what you want: + + sudo xcode-select -switch /Developer + sudo xcode-select -switch /Application/Xcode.app + + EOS + end +end + def check_user_path seen_prefix_bin = false seen_prefix_sbin = false @@ -835,6 +853,7 @@ module Homebrew extend self check_usr_bin_ruby check_homebrew_prefix check_xcode_prefix + check_xcode_select_path check_for_macgpg2 check_for_stray_dylibs check_for_stray_static_libs |
