From d7bc5835b953e70ef75057b3f042be55b0908d57 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 7 May 2019 10:50:19 +0100 Subject: [PATCH] formulary: recommend `brew extract`. This will provide a better experience to users rather than a URL that will likely break in future. --- Library/Homebrew/formulary.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 0e2de5ea60..307e8e2b50 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -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