formulary: recommend brew extract.

This will provide a better experience to users rather than a URL that
will likely break in future.
This commit is contained in:
Mike McQuaid 2019-05-07 10:50:19 +01:00
parent 4141c1bfa0
commit d7bc5835b9
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

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