ソースを参照

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