diff --git a/Library/Homebrew/extend/os/mac/search.rb b/Library/Homebrew/extend/os/mac/search.rb index 0b2c070acb..b937f64db4 100644 --- a/Library/Homebrew/extend/os/mac/search.rb +++ b/Library/Homebrew/extend/os/mac/search.rb @@ -34,7 +34,8 @@ module Homebrew results = cask_tokens.extend(Searchable) .search(string_or_regex) - results |= DidYouMean::SpellChecker.new(dictionary: cask_tokens) + cask_names = Cask::Cask.all.map(&:full_name) + results += DidYouMean::SpellChecker.new(dictionary: cask_names) .correct(string_or_regex) results.sort.map do |name| @@ -44,7 +45,7 @@ module Homebrew else cask.full_name end - end + end.uniq end end