Work with Xcode 4.3 if user didn't install helper tools
We ask Spotlight to find Xcode and use that path, neat right?
This commit is contained in:
parent
856fe669e2
commit
ba61d3013a
@ -96,7 +96,7 @@ module HomebrewEnvExtension
|
|||||||
else
|
else
|
||||||
# otherwise lets try and figure it out ourselves
|
# otherwise lets try and figure it out ourselves
|
||||||
fn = "#{MacOS.dev_tools_path}/#{tool}"
|
fn = "#{MacOS.dev_tools_path}/#{tool}"
|
||||||
if File.file? fn
|
if File.executable? fn
|
||||||
fn
|
fn
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
|
|||||||
@ -319,7 +319,16 @@ module MacOS extend self
|
|||||||
# fallback for broken Xcode 4.3 installs
|
# fallback for broken Xcode 4.3 installs
|
||||||
Pathname.new '/Applications/Xcode.app/Contents/Developer'
|
Pathname.new '/Applications/Xcode.app/Contents/Developer'
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user