Merge pull request #5017 from sjackman/locate

DevelopmentTools::locate: Prefer brewed tools [Linux]
This commit is contained in:
Mike McQuaid 2018-10-02 07:18:39 +01:00 committed by GitHub
commit 38287e6309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,15 @@
class DevelopmentTools
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
:gcc
end