search: don't fail because broken formulae
Fixes Homebrew/homebrew#44687. Closes Homebrew/homebrew#44770. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
1ae44d4429
commit
51a585e0b4
@ -141,9 +141,13 @@ module Homebrew
|
||||
results = (Formula.full_names+aliases).grep(rx).sort
|
||||
|
||||
results.map do |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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user