diff --git a/source/logger_sys.py b/source/logger_sys.py index 3ed65bb..bddd04a 100644 --- a/source/logger_sys.py +++ b/source/logger_sys.py @@ -7,14 +7,15 @@ def log_message(message): program_dir = str(appdirs.user_config_dir(appname='Bane-Of-Wargs')) # Create log file - os.mkdir(f'{program_dir}') - os.mkdir(f'{program_dir}/game') - os.mkdir(f'{program_dir}/game/data') - os.mkdir(f'{program_dir}/game/schemas') - os.mkdir(f'{program_dir}/game/imgs') - os.mkdir(f'{program_dir}/logs') - os.mkdir(f'{program_dir}/plugins') - os.mkdir(f'{program_dir}/saves') + if not os.path.exists(f'{program_dir}'): + os.mkdir(f'{program_dir}') + os.mkdir(f'{program_dir}/game') + os.mkdir(f'{program_dir}/game/data') + os.mkdir(f'{program_dir}/game/schemas') + os.mkdir(f'{program_dir}/game/imgs') + os.mkdir(f'{program_dir}/logs') + os.mkdir(f'{program_dir}/plugins') + os.mkdir(f'{program_dir}/saves') with open(f'{program_dir}/logs/{date.today()}.log', 'w') as f: f.write("LOG")