]> Softwares of Agnibho - statin.git/commitdiff
Fixed bug: create directory if files specified
authorAgnibho Mondal <mondal@agnibho.com>
Wed, 7 Feb 2018 16:21:51 +0000 (21:51 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Wed, 7 Feb 2018 16:21:51 +0000 (21:51 +0530)
statin/statin.py

index dcf097c203652abdcd0929e47f376a7e5f3da9b0..e1cb6c7ec7ea37a01feba8a30b6a96c931012973 100644 (file)
@@ -19,7 +19,7 @@ along with Statin.  If not, see <http://www.gnu.org/licenses/>.
 '''
 
 from glob import glob
-from os import path, popen, unlink
+from os import path, popen, unlink, makedirs
 from shutil import copyfile, rmtree, copytree, ignore_patterns
 from datetime import datetime
 import argparse
@@ -82,6 +82,8 @@ def main():
         copytree(".", OUTPUT_DIR, ignore=ignore_patterns(*PROCESS_PATT))
         if(not args.quiet):
             print("Contents copied to " + OUTPUT_DIR + "\n")
+    else:
+        makedirs(OUTPUT_DIR, exist_ok=True)
 
     # Send each file for processing
     for filename in filelist: