diff --git a/bin/rocco b/bin/rocco index 511a694..8814ee4 100755 --- a/bin/rocco +++ b/bin/rocco @@ -88,7 +88,7 @@ end # Run each file through Rocco and write output. sources.each do |filename| rocco = Rocco.new(filename, sources, options) - dest = File.join(output_dir, filename.split('.')[0..-2].join('.') + '.html') + dest = File.join(output_dir, (filename.split('.')[0..-2].empty? ? filename : filename.split('.')[0..-2].join('.')) + '.html') puts "rocco: #{filename} -> #{dest}" FileUtils.mkdir_p File.dirname(dest) File.open(dest, 'wb') { |fd| fd.write(rocco.to_html) }