Merge pull request #6104 from MikeMcQuaid/formulary-brew-extract-recommend

formulary: recommend `brew extract`.
This commit is contained in:
Mike McQuaid 2019-05-07 14:33:22 +01:00 committed by GitHub
commit 84085bd430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,6 +195,15 @@ module Formulary
end
def load_file
if url =~ %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(/Formula)?/([\w+-.@]+).rb}
formula_name = Regexp.last_match(2)
ohai "Consider using `brew extract #{formula_name} ...`!"
puts <<~EOS
This will extract your desired #{formula_name} version to a stable tap instead of
installing from an unstable URL!
EOS
end
HOMEBREW_CACHE_FORMULA.mkpath
FileUtils.rm_f(path)
curl_download url, to: path