Parcourir la source

Make destination dir before execution, or bail out.

Heikki Hokkanen il y a 18 ans
Parent
révision
6ba3c165ca
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5
    0
      statgit

+ 5
- 0
statgit Voir le fichier

@@ -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