Skip to content

Commit

Permalink
Merge pull request #19398 from toobuntu/search_formulae/issue_19397
Browse files Browse the repository at this point in the history
fix(search.rb): fix regex regression in search
  • Loading branch information
MikeMcQuaid authored Feb 28, 2025
2 parents b390a4d + 8bd3b48 commit 366a180
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Library/Homebrew/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ def self.search_formulae(string_or_regex)

aliases = Formula.alias_full_names
results = search(Formula.full_names + aliases, string_or_regex).sort
results |= Formula.fuzzy_search(string_or_regex).map { |n| Formulary.factory(n).full_name }
if string_or_regex.is_a?(String)
results |= Formula.fuzzy_search(string_or_regex).map do |n|
Formulary.factory(n).full_name
end
end

results.filter_map do |name|
formula, canonical_full_name = begin
Expand Down

0 comments on commit 366a180

Please sign in to comment.