diff options
| author | Max Howell | 2012-02-17 12:12:05 +0000 |
|---|---|---|
| committer | Max Howell | 2012-02-17 13:08:55 +0000 |
| commit | ba61d3013a9fa50e0af1f0c9fa508582fa55e740 (patch) | |
| tree | 72fe2ef118f957bddeba41fd5e1dd9fee06aa3b5 /Library/Homebrew/utils.rb | |
| parent | 856fe669e2fa123ef97b7a27afd216c0c26b1818 (diff) | |
| download | brew-ba61d3013a9fa50e0af1f0c9fa508582fa55e740.tar.bz2 | |
Work with Xcode 4.3 if user didn't install helper tools
We ask Spotlight to find Xcode and use that path, neat right?
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 9f7ef663c..bc0f570d9 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -319,7 +319,16 @@ module MacOS extend self # fallback for broken Xcode 4.3 installs Pathname.new '/Applications/Xcode.app/Contents/Developer' else - nil + # Ask Spotlight where Xcode is. If the user didn't install the + # helper tools and installed Xcode in a non-conventional place, this + # is our only option. See: http://superuser.com/questions/390757 + path = `mdfind "kMDItemDisplayName==Xcode&&kMDItemKind==Application"` + path = "#{path}/Contents/Developer" + if path.empty? or not File.directory? path + nil + else + path + end end end end |
