From 9a817e01c01e9ec0fd744c3414ae94cafbac0d6b Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Sun, 30 Jun 2024 17:48:22 -0400 Subject: [PATCH] w/ HOMEBREW_NO_INSTALL_FROM_API, require eval-all --- Library/Homebrew/cmd/desc.rb | 3 +++ Library/Homebrew/cmd/search.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 67d673c3fa8e92..a4e24c051e4463 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -47,6 +47,9 @@ def run end if search_type.present? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + raise UsageError, "`brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" + end query = args.named.join(" ") string_or_regex = Search.query_regexp(query) return Search.search_descriptions(string_or_regex, args, search_type:) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 4a7480119b87a1..d38f58d3f6a202 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -70,6 +70,9 @@ def run string_or_regex = Search.query_regexp(query) if args.desc? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + raise UsageError, "`brew search --desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" + end Search.search_descriptions(string_or_regex, args) elsif args.pull_request? search_pull_requests(query)