Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
KMSCAKKSCFKA AKFACAMADCAS
brew
提交
d749173a
提交
d749173a
编辑于
11月 23, 2021
作者:
XuehaiPan
浏览文件
utils: mark `reason` as keyword argument in `ensure_formula_installed!`
上级
7baaebe5
变更
7
Hide whitespace changes
Inline
Side-by-side
Library/Homebrew/dev-cmd/bottle.rb
浏览文件 @
d749173a
...
...
@@ -260,7 +260,7 @@ module Homebrew
return
default_tar_args
end
ensure_formula_installed!
(
gnu_tar
,
"for bottling"
)
ensure_formula_installed!
(
gnu_tar
,
reason:
"for bottling"
)
[
"
#{
gnu_tar
.
opt_bin
}
/gtar"
,
gnutar_args
].
freeze
end
...
...
Library/Homebrew/dev-cmd/bump.rb
浏览文件 @
d749173a
...
...
@@ -59,7 +59,7 @@ module Homebrew
unless
Utils
::
Curl
.
curl_supports_tls13?
begin
unless
Pathname
.
new
(
ENV
[
"HOMEBREW_BREWED_CURL_PATH"
]).
exist?
ensure_formula_installed!
(
"curl"
,
"for Repology queries"
)
ensure_formula_installed!
(
"curl"
,
reason:
"for Repology queries"
)
end
rescue
FormulaUnavailableError
opoo
"A `curl` with TLS 1.3 support is required for Repology queries."
...
...
Library/Homebrew/dev-cmd/cat.rb
浏览文件 @
d749173a
...
...
@@ -34,7 +34,7 @@ module Homebrew
ENV
[
"BAT_CONFIG_PATH"
]
=
Homebrew
::
EnvConfig
.
bat_config_path
ensure_formula_installed!
(
"bat"
,
"for displaying <formula>/<cask> source"
,
reason:
"for displaying <formula>/<cask> source"
,
# The user might want to capture the output of `brew cat ...`
# Redirect stdout to stderr
output_to_stderr:
true
,
...
...
Library/Homebrew/dev-cmd/tests.rb
浏览文件 @
d749173a
...
...
@@ -50,7 +50,7 @@ module Homebrew
with_env
(
HOMEBREW_NO_AUTO_UPDATE
:
"1"
,
HOMEBREW_NO_BOOTSNAP
:
"1"
)
do
ensure_formula_installed!
(
"buildpulse-test-reporter"
,
"for reporting test flakiness"
)
reason:
"for reporting test flakiness"
)
end
ENV
[
"BUILDPULSE_ACCESS_KEY_ID"
]
=
ENV
[
"HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"
]
...
...
Library/Homebrew/github_packages.rb
浏览文件 @
d749173a
...
...
@@ -53,7 +53,8 @@ class GitHubPackages
which
(
"skopeo"
,
ENV
[
"HOMEBREW_PATH"
]),
HOMEBREW_PREFIX
/
"bin/skopeo"
,
].
compact
.
first
skopeo
=
ensure_formula_installed!
(
"skopeo"
,
"for upload"
).
opt_bin
/
"skopeo"
unless
skopeo
.
exist?
skopeo
=
ensure_formula_installed!
(
"skopeo"
,
reason:
"for upload"
).
opt_bin
/
"skopeo"
unless
skopeo
.
exist?
require
"json_schemer"
...
...
Library/Homebrew/style.rb
浏览文件 @
d749173a
...
...
@@ -278,12 +278,14 @@ module Homebrew
def
shellcheck
# Always use the latest brewed shellcheck
ensure_formula_installed!
(
"shellcheck"
,
"for shell style checks"
,
latest:
true
).
opt_bin
/
"shellcheck"
ensure_formula_installed!
(
"shellcheck"
,
latest:
true
,
reason:
"for shell style checks"
).
opt_bin
/
"shellcheck"
end
def
shfmt
# Always use the latest brewed shfmt
ensure_formula_installed!
(
"shfmt"
,
"to format shell scripts"
,
latest:
true
)
ensure_formula_installed!
(
"shfmt"
,
latest:
true
,
reason:
"to format shell scripts"
)
HOMEBREW_LIBRARY
/
"Homebrew/utils/shfmt.sh"
end
...
...
Library/Homebrew/utils.rb
浏览文件 @
d749173a
...
...
@@ -456,7 +456,7 @@ 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
,
def
ensure_formula_installed!
(
formula_or_name
,
latest:
false
,
reason:
""
,
output_to_stderr:
true
,
quiet:
false
)
if
output_to_stderr
||
quiet
file
=
if
quiet
...
...
@@ -466,7 +466,8 @@ module Kernel
end
# Call this method itself with redirected stdout
redirect_stdout
(
file
)
do
return
ensure_formula_installed!
(
formula_or_name
,
reason
,
latest:
latest
,
output_to_stderr:
false
)
return
ensure_formula_installed!
(
formula_or_name
,
latest:
latest
,
reason:
reason
,
output_to_stderr:
false
)
end
end
...
...
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录