DevelopmentTools::locate: Prefer brewed tools [Linux]

This commit is contained in:
Shaun Jackman 2018-10-01 15:34:47 -07:00
parent bb038c7048
commit 447baab9a0

View File

@ -1,5 +1,15 @@
class DevelopmentTools class DevelopmentTools
class << self class << self
def locate(tool)
(@locate ||= {}).fetch(tool) do |key|
@locate[key] = if (path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
path
elsif File.executable?(path = "/usr/bin/#{tool}")
Pathname.new path
end
end
end
def default_compiler def default_compiler
:gcc :gcc
end end