Skip to content

Commit

Permalink
improve wording of desc search warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rrotter committed Jun 29, 2024
1 parent d2b177e commit 1b1e15f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Library/Homebrew/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def self.search_descriptions(string_or_regex, args, search_type: :desc)
else
unofficial = Tap.all.sum { |tap| tap.official? ? 0 : tap.formula_files.size }
if unofficial.positive?
opoo "#{unofficial} additional formula(e) in third party repositories were not searched. " \
"To search all formulae repeat this search with the flag `--eval-all`."
opoo "Use `--eval-all` to search #{unofficial} additional " \
"#{Utils.pluralize("formula", unofficial, plural: "e")} in third party taps."
end
descriptions = Homebrew::API::Formula.all_formulae.transform_values { |data| data["desc"] }
Descriptions.search(string_or_regex, search_type, descriptions, eval_all, cache_store_hash: true).print

Check warning on line 37 in Library/Homebrew/search.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/search.rb#L36-L37

Added lines #L36 - L37 were not covered by tests
Expand All @@ -50,10 +50,9 @@ def self.search_descriptions(string_or_regex, args, search_type: :desc)
else
unofficial = Tap.all.sum { |tap| tap.official? ? 0 : tap.cask_files.size }
if unofficial.positive?
opoo "#{unofficial} additional cask(s) in third party repositories were not searched. " \
"To search all casks repeat this search with the flag `--eval-all`."
opoo "Use `--eval-all` to search #{unofficial} additional " \
"#{Utils.pluralize("cask", unofficial)} in third party taps."
end
# descriptions = Homebrew::API::Cask.all_casks.transform_values { |data| data["desc"] }
descriptions = Homebrew::API::Cask.all_casks.transform_values { |c| [c["name"].join(", "), c["desc"]] }
Descriptions.search(string_or_regex, search_type, descriptions, eval_all, cache_store_hash: true).print

Check warning on line 57 in Library/Homebrew/search.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/search.rb#L56-L57

Added lines #L56 - L57 were not covered by tests
end
Expand Down

0 comments on commit 1b1e15f

Please sign in to comment.