Move outputpath handling in main(), create path if it doesn't exist
This commit is contained in:
parent
41009c85c7
commit
93f8a684f1
|
@ -9,7 +9,7 @@ import shlex
|
|||
import sys
|
||||
|
||||
from Main import main
|
||||
from Utils import is_bundled, close_console, output_path
|
||||
from Utils import is_bundled, close_console
|
||||
|
||||
|
||||
class ArgumentDefaultsHelpFormatter(argparse.RawTextHelpFormatter):
|
||||
|
@ -294,9 +294,6 @@ def parse_arguments(argv, no_defaults=False):
|
|||
def start():
|
||||
args = parse_arguments(None)
|
||||
|
||||
if args.outputpath and os.path.isdir(args.outputpath):
|
||||
output_path.cached_path = args.outputpath
|
||||
|
||||
if is_bundled() and len(sys.argv) == 1:
|
||||
# for the bundled builds, if we have no arguments, the user
|
||||
# probably wants the gui. Users of the bundled build who want the command line
|
||||
|
|
7
Main.py
7
Main.py
|
@ -22,6 +22,13 @@ from Utils import output_path, parse_names_string
|
|||
__version__ = '0.6.3-pre'
|
||||
|
||||
def main(args, seed=None):
|
||||
if args.outputpath:
|
||||
try:
|
||||
os.mkdir(args.outputpath)
|
||||
except OSError:
|
||||
pass
|
||||
output_path.cached_path = args.outputpath
|
||||
|
||||
start = time.process_time()
|
||||
|
||||
# initialize the world
|
||||
|
|
Loading…
Reference in New Issue