Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formulary: recommend brew extract. #6104

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions Library/Homebrew/formulary.rb
Expand Up @@ -195,6 +195,15 @@ def initialize(url)
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
Expand Down