Skip to content

Commit ba4ca60

Browse files
committed
Do not emit a comma for the final item in JSON output
This avoids producing JSON that is not parsable.
1 parent 06e2595 commit ba4ca60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/wayback_machine_downloader.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,10 @@ def list_files
177177
files = get_file_list_by_timestamp
178178
$stdout = @orig_stdout
179179
puts "["
180-
files.each do |file|
180+
files[0...-1].each do |file|
181181
puts file.to_json + ","
182182
end
183+
puts files[-1].to_json
183184
puts "]"
184185
end
185186

0 commit comments

Comments
 (0)