Merge pull request #3977 from MikeMcQuaid/no-duplicate-env

system_config: never display default_hash keys.
This commit is contained in:
Mike McQuaid 2018-03-25 10:06:32 +01:00 committed by GitHub
commit 98f6f6b7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,10 +200,13 @@ class SystemConfig
if defaults_hash[:HOMEBREW_CELLAR] != HOMEBREW_CELLAR.to_s
f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}"
end
if defaults_hash[:HOMEBREW_CACHE] != HOMEBREW_CACHE.to_s
f.puts "HOMEBREW_CACHE: #{HOMEBREW_CACHE}"
end
ENV.sort.each do |key, value|
next unless key.start_with?("HOMEBREW_")
next if boring_keys.include?(key)
next if defaults_hash[key.to_sym] == value
next if defaults_hash[key.to_sym]
value = "set" if key =~ /(cookie|key|token|password)/i
f.puts "#{key}: #{value}"
end