os/mac: don't use Formula.factory unnecessarily.

Instead check if the path exists by using opt.
This commit is contained in:
Mike McQuaid 2014-05-05 13:38:47 +01:00
parent 4f466b6c10
commit 5955f2a395

View File

@ -121,7 +121,7 @@ module OS
end
def non_apple_gcc_version(cc)
path = Formula.factory("gcc").opt_prefix/"bin/#{cc}"
path = HOMEBREW_PREFIX.join("opt/gcc/bin/#{cc}")
path = nil unless path.exist?
return unless path ||= locate(cc)