Skip to content
Snippets Groups Projects
Commit 51a585e0 authored by Xu Cheng's avatar Xu Cheng
Browse files

search: don't fail because broken formulae


Fixes Homebrew/homebrew#44687.

Closes Homebrew/homebrew#44770.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent 1ae44d44
No related branches found
No related tags found
No related merge requests found
......@@ -141,9 +141,13 @@ module Homebrew
results = (Formula.full_names+aliases).grep(rx).sort
results.map do |name|
formula = Formulary.factory(name)
canonical_name = formula.name
canonical_full_name = formula.full_name
begin
formula = Formulary.factory(name)
canonical_name = formula.name
canonical_full_name = formula.full_name
rescue
canonical_name = canonical_full_name = name
end
# Ignore aliases from results when the full name was also found
if aliases.include?(name) && results.include?(canonical_full_name)
next
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment