mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Do not emit a comma for the final item in JSON output
This avoids producing JSON that is not parsable.
This commit is contained in:
parent
06e25957b6
commit
ba4ca60377
@ -177,9 +177,10 @@ class WaybackMachineDownloader
|
|||||||
files = get_file_list_by_timestamp
|
files = get_file_list_by_timestamp
|
||||||
$stdout = @orig_stdout
|
$stdout = @orig_stdout
|
||||||
puts "["
|
puts "["
|
||||||
files.each do |file|
|
files[0...-1].each do |file|
|
||||||
puts file.to_json + ","
|
puts file.to_json + ","
|
||||||
end
|
end
|
||||||
|
puts files[-1].to_json
|
||||||
puts "]"
|
puts "]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user