search: Print error message to stderr when not using a tty
This commit is contained in:
parent
2baabf58d4
commit
9e9e2e63e8
@ -108,9 +108,8 @@ module Homebrew
|
|||||||
puts Formatter.columns(all_casks)
|
puts Formatter.columns(all_casks)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
count = all_formulae.count + all_casks.count
|
||||||
if $stdout.tty?
|
if $stdout.tty?
|
||||||
count = all_formulae.count + all_casks.count
|
|
||||||
|
|
||||||
if (reason = MissingFormula.reason(query, silent: true)) && !local_casks.include?(query)
|
if (reason = MissingFormula.reason(query, silent: true)) && !local_casks.include?(query)
|
||||||
if count.positive?
|
if count.positive?
|
||||||
puts
|
puts
|
||||||
@ -121,6 +120,8 @@ module Homebrew
|
|||||||
puts "No formula or cask found for #{query.inspect}."
|
puts "No formula or cask found for #{query.inspect}."
|
||||||
GitHub.print_pull_requests_matching(query)
|
GitHub.print_pull_requests_matching(query)
|
||||||
end
|
end
|
||||||
|
elsif count.zero?
|
||||||
|
$stderr.puts "No formula or cask found for #{query.inspect}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user