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:
parent
47b7bf378e
commit
c834a862ab
@ -974,7 +974,11 @@ class ReporterHub
|
|||||||
# Skip non-homebrew/core formulae for security.
|
# Skip non-homebrew/core formulae for security.
|
||||||
return if formula.include?("/")
|
return if formula.include?("/")
|
||||||
|
|
||||||
|
begin
|
||||||
Formula[formula].desc&.presence
|
Formula[formula].desc&.presence
|
||||||
|
rescue FormulaUnavailableError
|
||||||
|
nil
|
||||||
|
end
|
||||||
else
|
else
|
||||||
all_formula_json.find { |f| f["name"] == formula }
|
all_formula_json.find { |f| f["name"] == formula }
|
||||||
&.fetch("desc", nil)
|
&.fetch("desc", nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user