浏览代码

Make destination dir before execution, or bail out.

Heikki Hokkanen 18 年前
父节点
当前提交
6ba3c165ca
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      statgit

+ 5
- 0
statgit 查看文件

@@ -704,6 +704,11 @@ if len(sys.argv) <  3:
704 704
 gitpath = sys.argv[1]
705 705
 outputpath = os.path.abspath(sys.argv[2])
706 706
 
707
+os.makedirs(outputpath)
708
+if not os.path.isdir(outputpath):
709
+	print 'FATAL: Output path is not a directory or does not exist'
710
+	sys.exit(1)
711
+
707 712
 print 'Git path: %s' % gitpath
708 713
 print 'Output path: %s' % outputpath
709 714