mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
fix(search.rb): fix regex regression in search
Fixes a regression in `brew search` which prevented using a regex for the search pattern after strict typing was added to `formula.rb` in commit a81239e. Now performs fuzzy search only if input is a string. Closes #19397
This commit is contained in:
parent
38385c8cbf
commit
8bd3b48258
@ -69,7 +69,11 @@ module Homebrew
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user