Print progress messages to stderr when printing JSON

This avoids the messages breaking JSON parsing when
the output is being redirected to a file and parsed.
This commit is contained in:
Paul Wise 2021-05-03 20:52:28 +08:00
parent ea15965d6d
commit 06e25957b6
No known key found for this signature in database
GPG Key ID: 3116BA5E9FFA69A3

View File

@ -172,7 +172,10 @@ class WaybackMachineDownloader
def list_files
# retrieval produces its own output
@orig_stdout = $stdout
$stdout = $stderr
files = get_file_list_by_timestamp
$stdout = @orig_stdout
puts "["
files.each do |file|
puts file.to_json + ","