From 852e3fe72ea289891cbeef8a194ade69a07c5ae0 Mon Sep 17 00:00:00 2001 From: Harald Nordgren Date: Wed, 7 Aug 2024 19:20:53 +0200 Subject: [PATCH] Show installations status for cask dependencies --- Library/Homebrew/cask/info.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/info.rb b/Library/Homebrew/cask/info.rb index 11b6149428ba11..72d2d2ee1fc27b 100644 --- a/Library/Homebrew/cask/info.rb +++ b/Library/Homebrew/cask/info.rb @@ -80,10 +80,12 @@ def self.desc_info(cask) sig { params(cask: Cask).returns(T.nilable(String)) } def self.deps_info(cask) + require "utils/info" + depends_on = cask.depends_on - formula_deps = Array(depends_on[:formula]).map(&:to_s) - cask_deps = Array(depends_on[:cask]).map { |dep| "#{dep} (cask)" } + formula_deps = depends_on[:formula] && !depends_on[:formula].empty? ? ::Utils::Info.decorate_dependencies(depends_on[:formula]) : [] + cask_deps = depends_on[:cask] && !depends_on[:cask].empty? ? ::Utils::Info.decorate_dependencies(depends_on[:cask]) : [] all_deps = formula_deps + cask_deps return if all_deps.empty?