From b749cbcffdc07415005ea879fff59e0e94989855 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 19 Aug 2025 16:18:15 +0800 Subject: [PATCH] diagnostic: fix cask env var output With `each`, we don't actually output the processed values. We should therefore be using `filter_map` instead. --- Library/Homebrew/diagnostic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 0c2e7b2935..01aa5d7465 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1068,7 +1068,7 @@ module Homebrew locale_variables = ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).sort - cask_environment_variables = (locale_variables + environment_variables).sort.each do |var| + cask_environment_variables = (locale_variables + environment_variables).sort.filter_map do |var| next unless ENV.key?(var) var = %Q(#{var}="#{ENV.fetch(var)}")