提交 06e6e015 编写于 作者: 张重言's avatar 张重言 🌈

rename before generate md filr

上级 bb278bf3
......@@ -3,6 +3,8 @@ require_relative './md_generator'
class BatchGenerator
def execute
rename_docxs
file_names = Dir.entries('docxs')
result = {}
......@@ -23,5 +25,15 @@ class BatchGenerator
p "success: #{result.select{|k, v| v}.keys}"
end
def rename_docxs
file_names = Dir.entries('docxs')
index = 1
file_names.each do |file_name|
next if file_name.start_with?(".")
`mv docxs/#{file_name} docxs/#{index}.docx`
index += 1
end
end
end
BatchGenerator.new.execute
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册