diff --git a/nzbToMediaUtil.py b/nzbToMediaUtil.py index ddb23e5e..e318c2d5 100644 --- a/nzbToMediaUtil.py +++ b/nzbToMediaUtil.py @@ -1,6 +1,6 @@ import logging import logging.config -import os.path +import os import sys @@ -23,6 +23,16 @@ def create_destination(outputDestination): sys.exit(-1) +def create_destination(outputDestination): + if not os.path.exists(outputDestination): + try: + Logger.info("CREATE DESTINATION: Creating destination folder: %s", outputDestination) + os.makedirs(outputDestination) + except Exception, e: + Logger.error("CREATE DESTINATION: Not possible to create destination folder: %s. Exiting", e) + sys.exit(-1) + + def parse_other(args): return os.path.normpath(sys.argv[1]), '', '', ''