Fix case when file wasn't created

This commit is contained in:
hartator 2016-08-10 14:32:41 -05:00
parent 5532a6408b
commit e7fc5a2eb9

View File

@ -171,7 +171,7 @@ class WaybackMachineDownloader
rescue StandardError => e
puts "#{file_url} # #{e}"
ensure
if File.size(file_path) == 0 and not @all
if not @all and File.exists?(file_path) and File.size(file_path) == 0
File.delete(file_path)
puts "#{file_path} was empty and was removed."
end