Compare commits

...

6 Commits

Author SHA1 Message Date
Ruoyu Zhong
41198d866f
Merge pull request #20684 from Homebrew/update-report-desc
cmd/update-report: fix formula description display
2025-09-13 16:06:18 +00:00
Mike McQuaid
8304edbf2c
Merge pull request #20675 from Homebrew/shellenv_echo_path_helper
cmd/shellenv: echo path helper command rather than run it.
2025-09-13 15:56:32 +00:00
Ruoyu Zhong
96048f0a5a
cmd/update-report: fix cask desc display too 2025-09-13 23:48:15 +08:00
Ruoyu Zhong
c834a862ab
cmd/update-report: fix formula description display
When on a non-default branch (for e.g., testing), `Formula[formula]` can
return an error. In that case let's silently ignore it.
2025-09-13 23:27:25 +08:00
Carlo Cabrera
57578cf91a
Fix path_helper usage
The output of `path_helper` needs to be `eval`ed for it to work.
2025-09-13 13:32:16 +08:00
Mike McQuaid
00a49bf8e1
cmd/shellenv: echo path helper command rather than run it.
This is faster at both execution and `eval`ing than the existing version
and aids caching.
2025-09-12 08:30:12 +01:00
2 changed files with 12 additions and 4 deletions

View File

@ -50,7 +50,7 @@ homebrew-shellenv() {
echo "setenv HOMEBREW_REPOSITORY ${HOMEBREW_REPOSITORY};"
if [[ -n "${PATH_HELPER_ROOT}" ]]
then
PATH_HELPER_ROOT="${PATH_HELPER_ROOT}" PATH="${HOMEBREW_PATH}" /usr/libexec/path_helper -c
echo "eval \`PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -c\`;"
else
echo "setenv PATH ${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:\$PATH;"
fi
@ -75,7 +75,7 @@ homebrew-shellenv() {
fi
if [[ -n "${PATH_HELPER_ROOT}" ]]
then
PATH_HELPER_ROOT="${PATH_HELPER_ROOT}" PATH="${HOMEBREW_PATH}" /usr/libexec/path_helper -s
echo "eval \"\$(PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -s)\""
else
echo "export PATH=\"${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin\${PATH+:\$PATH}\";"
fi

View File

@ -974,7 +974,11 @@ class ReporterHub
# Skip non-homebrew/core formulae for security.
return if formula.include?("/")
begin
Formula[formula].desc&.presence
rescue FormulaUnavailableError
nil
end
else
all_formula_json.find { |f| f["name"] == formula }
&.fetch("desc", nil)
@ -988,7 +992,11 @@ class ReporterHub
# Skip non-homebrew/cask formulae for security.
return if cask.include?("/")
begin
Cask::CaskLoader.load(cask).desc&.presence
rescue Cask::CaskError
nil
end
else
all_cask_json.find { |f| f["token"] == cask }
&.fetch("desc", nil)