Fix brew search for HOMEBREW_INSTALL_FROM_API

This commit is contained in:
Rylan Polster 2023-01-23 13:32:54 -05:00
parent 462c69d3d5
commit cc615ef7fb
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
2 changed files with 18 additions and 0 deletions

View File

@ -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)

View File

@ -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)`.