Merge pull request #14232 from MikeMcQuaid/brew_search_args
description*: fix argument handling of eval_all.
This commit is contained in:
commit
2fb9f9ca13
@ -101,8 +101,8 @@ class CaskDescriptionCacheStore < DescriptionCacheStore
|
|||||||
# If the database is empty `update!` it with all known casks.
|
# If the database is empty `update!` it with all known casks.
|
||||||
#
|
#
|
||||||
# @return [nil]
|
# @return [nil]
|
||||||
def populate_if_empty!
|
def populate_if_empty!(eval_all: Homebrew::EnvConfig.eval_all?)
|
||||||
return unless Homebrew::EnvConfig.eval_all?
|
return unless eval_all
|
||||||
return unless database.empty?
|
return unless database.empty?
|
||||||
|
|
||||||
Cask::Cask.all.each { |c| update!(c.full_name, [c.name.join(", "), c.desc.presence]) }
|
Cask::Cask.all.each { |c| update!(c.full_name, [c.name.join(", "), c.desc.presence]) }
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class Descriptions
|
|||||||
extend Homebrew::Search
|
extend Homebrew::Search
|
||||||
|
|
||||||
# Given a regex, find all formulae whose specified fields contain a match.
|
# Given a regex, find all formulae whose specified fields contain a match.
|
||||||
def self.search(string_or_regex, field, cache_store, eval_all)
|
def self.search(string_or_regex, field, cache_store, eval_all = Homebrew::EnvConfig.eval_all?)
|
||||||
cache_store.populate_if_empty!(eval_all: eval_all)
|
cache_store.populate_if_empty!(eval_all: eval_all)
|
||||||
|
|
||||||
results = case field
|
results = case field
|
||||||
|
|||||||
@ -16,7 +16,8 @@ module Homebrew
|
|||||||
ohai "Casks"
|
ohai "Casks"
|
||||||
CacheStoreDatabase.use(:cask_descriptions) do |db|
|
CacheStoreDatabase.use(:cask_descriptions) do |db|
|
||||||
cache_store = CaskDescriptionCacheStore.new(db)
|
cache_store = CaskDescriptionCacheStore.new(db)
|
||||||
Descriptions.search(string_or_regex, :desc, cache_store).print
|
eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all?
|
||||||
|
Descriptions.search(string_or_regex, :desc, cache_store, eval_all).print
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,8 @@ module Homebrew
|
|||||||
ohai "Formulae"
|
ohai "Formulae"
|
||||||
CacheStoreDatabase.use(:descriptions) do |db|
|
CacheStoreDatabase.use(:descriptions) do |db|
|
||||||
cache_store = DescriptionCacheStore.new(db)
|
cache_store = DescriptionCacheStore.new(db)
|
||||||
Descriptions.search(string_or_regex, :desc, cache_store).print
|
eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all?
|
||||||
|
Descriptions.search(string_or_regex, :desc, cache_store, eval_all).print
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user