aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/ENV.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/ENV.rb')
-rw-r--r--Library/Homebrew/extend/ENV.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 729598e28..283e90b69 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -26,6 +26,13 @@ module EnvActivation
ensure
replace(old_env)
end
+
+ def clear_sensitive_environment!
+ ENV.keys.each do |key|
+ next unless /(cookie|key|token)/i =~ key
+ ENV.delete key
+ end
+ end
end
ENV.extend(EnvActivation)