Skip to content

Commit

Permalink
Do not emit a comma for the final item in JSON output
Browse files Browse the repository at this point in the history
This avoids producing JSON that is not parsable.
  • Loading branch information
pabs3 committed May 3, 2021
1 parent 06e2595 commit ba4ca60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wayback_machine_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ def list_files
files = get_file_list_by_timestamp
$stdout = @orig_stdout
puts "["
files.each do |file|
files[0...-1].each do |file|
puts file.to_json + ","
end
puts files[-1].to_json
puts "]"
end

Expand Down

0 comments on commit ba4ca60

Please sign in to comment.