mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
[downloader]: Fix broken progress bar when content-length not provided (#8010)
* downloader: Fix broken progress bar * Fix syntax error * Fix variable scope * Revert last changes * Remove redundant space
This commit is contained in:
@@ -102,15 +102,10 @@ class ProgressBar
|
||||
end
|
||||
|
||||
# stop when 100%
|
||||
if @percentage >= 100
|
||||
print "\e[2K\r" # clear previous line (progress bar)
|
||||
break
|
||||
else
|
||||
print "\r"
|
||||
end
|
||||
@percentage >= 100 ? break : print("\r")
|
||||
end
|
||||
ensure
|
||||
print "\e[?25h" # restore cursor mode since we hide it before
|
||||
print "\e[2K\r\e[?25h" # clear line and restore cursor mode
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user