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?
|
if shell.nil?
|
||||||
dump_build_env ENV
|
dump_build_env ENV
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -21,7 +21,7 @@ module Utils
|
|||||||
end
|
end
|
||||||
|
|
||||||
# quote values. quoting keys is overkill
|
# quote values. quoting keys is overkill
|
||||||
def export_value(shell, key, value)
|
def export_value(key, value, shell = preferred)
|
||||||
case shell
|
case shell
|
||||||
when :bash, :ksh, :sh, :zsh
|
when :bash, :ksh, :sh, :zsh
|
||||||
"export #{key}=\"#{sh_quote(value)}\""
|
"export #{key}=\"#{sh_quote(value)}\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user