From 68c5d616c2827aba8aa23a114f56e887b890f64b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 11 Jun 2024 09:57:07 +0100 Subject: [PATCH] diagnostic: don't show cask taps with no casks. This avoids displaying a bunch of non-cask taps here. --- Library/Homebrew/diagnostic.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 950279a846..63e681a103 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -945,16 +945,17 @@ module Homebrew taps = (Tap.to_a + [CoreCaskTap.instance]).uniq - add_info "Homebrew Cask Taps:", (taps.map do |tap| + add_info "Homebrew Cask Taps:", taps.filter_map do |tap| cask_count = begin tap.cask_files.count rescue error_tap_paths << tap.path 0 end + next if cask_count.zero? "#{tap.path} (#{Utils.pluralize("cask", cask_count, include_count: true)})" - end) + end taps_string = Utils.pluralize("tap", error_tap_paths.count) "Unable to read from cask #{taps_string}: #{error_tap_paths.to_sentence}" if error_tap_paths.present?