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.
This commit is contained in:
Ruoyu Zhong 2025-09-13 23:27:25 +08:00
parent 47b7bf378e
commit c834a862ab
No known key found for this signature in database

View File

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