From f099256fef4686ad8545c7eac29a4d0c51e72536 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 26 Oct 2020 11:48:06 +0000 Subject: [PATCH] install: tweak missing formula behaviour. - Run `brew search` for local formulae first (as it's quickest) rather than checking Git history. - Don't output `Searching taps...` because `Searching taps on GitHub...` is output by the called function (and because it'll say it's searching taps even when it is not if `HOMEBREW_NO_GITHUB_API` is set). --- Library/Homebrew/cmd/install.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 576c780dc4..3f72fa2b28 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -304,12 +304,6 @@ module Homebrew return end - ofail e.message - if (reason = MissingFormula.reason(e.name)) - $stderr.puts reason - return - end - ohai "Searching for similarly named formulae..." formulae_search_results = search_formulae(e.name) case formulae_search_results.length @@ -325,10 +319,15 @@ module Homebrew puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}" end + ofail e.message + if (reason = MissingFormula.reason(e.name)) + $stderr.puts reason + return + end + # Do not search taps if the formula name is qualified return if e.name.include?("/") - ohai "Searching taps..." taps_search_results = search_taps(e.name)[:formulae] case taps_search_results.length when 0