diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index 632ab6e3c2..2644affa88 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -137,6 +137,10 @@ module Homebrew c.sub(%r{^homebrew/cask.*/}, "") end + if !Tap.fetch("homebrew/cask").installed? && Homebrew::EnvConfig.install_from_api? + cask_tokens += Homebrew::API::Cask.all_casks.keys + end + results = cask_tokens.extend(Searchable) .search(string_or_regex) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index a099b65977..a6aed47cbd 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -927,6 +927,20 @@ class CoreTap < Tap def alias_file_to_name(file) file.basename.to_s end + + # @private + def aliases + return super if installed? || !Homebrew::EnvConfig.install_from_api? + + Homebrew::API::Formula.all_aliases.keys + end + + # @private + def formula_names + return super if installed? || !Homebrew::EnvConfig.install_from_api? + + Homebrew::API::Formula.all_formulae.keys + end end # Permanent configuration per {Tap} using `git-config(1)`.