提交 7baaebe5 编辑于 作者: XuehaiPan's avatar XuehaiPan
浏览文件

utils: send output to stderr by default for `ensure_formula_installed!`

上级 3376479e
......@@ -456,8 +456,8 @@ module Kernel
# Ensure the given formula is installed
# This is useful for installing a utility formula (e.g. `shellcheck` for `brew style`)
def ensure_formula_installed!(formula_or_name, reason = "", latest: false, linked: false,
output_to_stderr: false, quiet: false)
def ensure_formula_installed!(formula_or_name, reason = "", latest: false,
output_to_stderr: true, quiet: false)
if output_to_stderr || quiet
file = if quiet
File::NULL
......@@ -466,7 +466,7 @@ module Kernel
end
# Call this method itself with redirected stdout
redirect_stdout(file) do
return ensure_formula_installed!(formula_or_name, reason, latest: latest, linked: linked)
return ensure_formula_installed!(formula_or_name, reason, latest: latest, output_to_stderr: false)
end
end
......@@ -490,8 +490,6 @@ module Kernel
safe_system HOMEBREW_BREW_FILE, "upgrade", "--formula", formula.full_name
end
safe_system HOMEBREW_BREW_FILE, "link", formula.full_name if linked && !formula.linked?
formula
end
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册