mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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:
parent
b74974611c
commit
74c77db5bd
@ -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
|
||||
|
@ -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)}\""
|
||||
|
Loading…
x
Reference in New Issue
Block a user