WebHostLib.options: move to makedirs instead of mkdir.

This commit is contained in:
Fabian Dill 2021-10-19 02:50:18 +02:00
parent a43b027cde
commit 28e724da98
1 changed files with 2 additions and 4 deletions

View File

@ -32,8 +32,7 @@ def create():
dictify_range=dictify_range, default_converter=default_converter, dictify_range=dictify_range, default_converter=default_converter,
) )
if not os.path.isdir(os.path.join(target_folder, 'configs')): os.makedirs(os.path.join(target_folder, 'configs'), exist_ok=True)
os.mkdir(os.path.join(target_folder, 'configs'))
with open(os.path.join(target_folder, 'configs', game_name + ".yaml"), "w") as f: with open(os.path.join(target_folder, 'configs', game_name + ".yaml"), "w") as f:
f.write(res) f.write(res)
@ -81,8 +80,7 @@ def create():
player_settings["gameOptions"] = game_options player_settings["gameOptions"] = game_options
if not os.path.isdir(os.path.join(target_folder, 'player-settings')): os.makedirs(os.path.join(target_folder, 'player-settings'), exist_ok=True)
os.mkdir(os.path.join(target_folder, 'player-settings'))
with open(os.path.join(target_folder, 'player-settings', game_name + ".json"), "w") as f: with open(os.path.join(target_folder, 'player-settings', game_name + ".json"), "w") as f:
f.write(json.dumps(player_settings, indent=2, separators=(',', ': '))) f.write(json.dumps(player_settings, indent=2, separators=(',', ': ')))