From 5d1576784a5603662ca9910eb97c948e833f35c9 Mon Sep 17 00:00:00 2001 From: Doug Hazell Date: Sun, 19 Feb 2017 02:12:46 +0000 Subject: Mechanism to dynamically add HOMEBREW.* vars to 'env -i' command string in 'bin/brew' --- Library/Homebrew/utils/homebrew_vars.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 Library/Homebrew/utils/homebrew_vars.rb (limited to 'Library') diff --git a/Library/Homebrew/utils/homebrew_vars.rb b/Library/Homebrew/utils/homebrew_vars.rb new file mode 100755 index 000000000..057633b77 --- /dev/null +++ b/Library/Homebrew/utils/homebrew_vars.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +ENV.keys.each do |key| + if key =~ /^HOMEBREW.*/ + # Remove any HOMEBREW.* vars containing white-space which causes a problem for "env -i" command via string. + # + # (Any user supplied HOMEBREW.* vars with valid white-space need to be hard-coded in 'bin/brew') + # + puts "#{key}=#{ENV[key]}" unless ENV[key].split(' ').length > 1 + end +end -- cgit v1.2.3