Skip to content
Snippets Groups Projects
Commit 9e9e2e63 authored by William Ma's avatar William Ma
Browse files

search: Print error message to stderr when not using a tty

parent 2baabf58
No related branches found
No related tags found
No related merge requests found
......@@ -108,9 +108,8 @@ module Homebrew
puts Formatter.columns(all_casks)
end
count = all_formulae.count + all_casks.count
if $stdout.tty?
count = all_formulae.count + all_casks.count
if (reason = MissingFormula.reason(query, silent: true)) && !local_casks.include?(query)
if count.positive?
puts
......@@ -121,6 +120,8 @@ module Homebrew
puts "No formula or cask found for #{query.inspect}."
GitHub.print_pull_requests_matching(query)
end
elsif count.zero?
$stderr.puts "No formula or cask found for #{query.inspect}."
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment