From 94625d51d6d4c66679838e56b4daa09ee31a1613 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 24 Mar 2022 23:02:55 +0900 Subject: [PATCH] repair search_casks --- Library/Homebrew/extend/os/mac/search.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/search.rb b/Library/Homebrew/extend/os/mac/search.rb index 4fee7f8f37..76763251f4 100644 --- a/Library/Homebrew/extend/os/mac/search.rb +++ b/Library/Homebrew/extend/os/mac/search.rb @@ -36,8 +36,10 @@ module Homebrew results = cask_tokens.extend(Searchable) .search(string_or_regex) - results |= DidYouMean::SpellChecker.new(dictionary: cask_tokens) - .correct(string_or_regex) + if results.empty? + cask_names = Cask::Cask.all.map(&:full_name) + results = DidYouMean::SpellChecker.new(dictionary: cask_names).correct(string_or_regex) + end results.sort.map do |name| cask = Cask::CaskLoader.load(name)