aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-08-23 18:40:30 +0100
committerMike McQuaid2017-08-23 18:40:30 +0100
commitf0605f4a30ae1125ad2e3d8187a45af09b24def0 (patch)
tree0730fce9120c446a049551ae97c4cfd31b89c962
parent2c43e069c25e3c7cc255f5cd105df3597246b952 (diff)
downloadbrew-f0605f4a30ae1125ad2e3d8187a45af09b24def0.tar.bz2
audit: don't output when searching taps.
This messaging was added for the `brew search` command and having it in audit is annoying: (https://github.com/Homebrew/brew/pull/3059#issuecomment-323638672) As a side note: this is why randomly including `cmd/*` is a bad idea.
-rw-r--r--Library/Homebrew/cmd/search.rb6
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb2
2 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 4a3e21971..acee9817f 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -102,11 +102,13 @@ module Homebrew
odie "#{query} is not a valid regex"
end
- def search_taps(query)
+ def search_taps(query, silent: false)
return [] if ENV["HOMEBREW_NO_GITHUB_API"]
# Use stderr to avoid breaking parsed output
- $stderr.puts Formatter.headline("Searching taps on GitHub...", color: :blue)
+ unless silent
+ $stderr.puts Formatter.headline("Searching taps on GitHub...", color: :blue)
+ end
valid_dirnames = ["Formula", "HomebrewFormula", "Casks", "."].freeze
matches = GitHub.search_code(user: ["Homebrew", "caskroom"], filename: query, extension: "rb")
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 170fb6d5f..89a6fb009 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -412,7 +412,7 @@ class FormulaAuditor
same_name_tap_formulae = @@local_official_taps_name_map[name] || []
if @online
- Homebrew.search_taps(name).each do |tap_formula_full_name|
+ Homebrew.search_taps(name, silent: true).each do |tap_formula_full_name|
tap_formula_name = tap_formula_full_name.split("/").last
next if tap_formula_name != name
same_name_tap_formulae << tap_formula_full_name