shell: tweak export_value parameters.

Let’s have a default value for shell (considering this isn’t a public
API) to make it easier to use.
This commit is contained in:
Mike McQuaid 2018-07-26 10:48:25 +01:00
parent b74974611c
commit 74c77db5bd
2 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,9 @@ module Homebrew
if shell.nil?
dump_build_env ENV
else
env_keys.each { |key| puts Utils::Shell.export_value(shell, key, ENV[key]) }
env_keys.each do |key|
puts Utils::Shell.export_value(key, ENV[key], shell)
end
end
end
end

View File

@ -21,7 +21,7 @@ module Utils
end
# quote values. quoting keys is overkill
def export_value(shell, key, value)
def export_value(key, value, shell = preferred)
case shell
when :bash, :ksh, :sh, :zsh
"export #{key}=\"#{sh_quote(value)}\""