livecheck: fix TTY output for progress bar
This commit is contained in:
parent
cf293d0ef5
commit
56a8f8f99d
@ -75,7 +75,10 @@ module Homebrew
|
||||
formulae_to_check.length
|
||||
end
|
||||
|
||||
$stderr.puts Formatter.headline("Running checks", color: :blue)
|
||||
Tty.with($stderr) do |stderr|
|
||||
stderr.puts Formatter.headline("Running checks", color: :blue)
|
||||
end
|
||||
|
||||
progress = ProgressBar.create(
|
||||
total: total_formulae,
|
||||
progress_mark: "#",
|
||||
@ -182,7 +185,9 @@ module Homebrew
|
||||
|
||||
if progress
|
||||
progress.finish
|
||||
$stderr.print "#{Tty.up}#{Tty.erase_line}" * 2
|
||||
Tty.with($stderr) do |stderr|
|
||||
stderr.print "#{Tty.up}#{Tty.erase_line}" * 2
|
||||
end
|
||||
end
|
||||
|
||||
puts JSON.generate(formulae_checked.compact)
|
||||
|
||||
@ -88,7 +88,7 @@ module Tty
|
||||
|
||||
SPECIAL_CODES.each do |name, code|
|
||||
define_singleton_method(name) do
|
||||
if $stdout.tty?
|
||||
if @stream.tty?
|
||||
"\033[#{code}"
|
||||
else
|
||||
""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user