lib/oddb2xml/cli.rb in oddb2xml-2.6.8 vs lib/oddb2xml/cli.rb in oddb2xml-2.6.9
- old
+ new
@@ -155,10 +155,12 @@
fh.puts(Oddb2xml.convert_to_8859_1(line))
end
end
end
if @options[:calc]
- FileUtils.cp(File.join(WorkDir, file), File.join(WorkDir, file.sub('.xml', '_'+Time.now.strftime("%d.%m.%Y_%H.%M")+'.xml')), :verbose => false)
+ ext = File.extname(file)
+ dest = File.join(WorkDir, file.sub(ext, '_'+Time.now.strftime("%d.%m.%Y_%H.%M")+ext))
+ FileUtils.cp(File.join(WorkDir, file), dest, :verbose => false)
end
end
rescue Interrupt
files.values.each do |file|
if File.exist? file