exe/site.rb in m2m-0.2.0 vs exe/site.rb in m2m-0.2.1

- old
+ new

@@ -8,10 +8,11 @@ c.summary = '' c.description = '' c.option '-s STRING', '--source STRING', String, 'Markdown源文件的目录' c.option '-t STRING', '--target STRING', String, '生成的目标目录' c.option '--force', String, '强行生成,如果目录存在,则会被删除' + c.option '--git', String, '提交到git仓库' c.action do |args, options| target = options.target source = options.source @@ -30,8 +31,13 @@ util.error tips if not (options.force or agree question) end #执行生成 Generator.new + + if options.git + command = "cd #{util.workbench} && git add . && git commit -m 'update by m2m' && git push"; + exec command + end end end end \ No newline at end of file