Move config files and player-settings js files to /generated/configs and /generated/player-settings and update the pages that use them

This commit is contained in:
Chris Wilson
2021-10-11 21:37:08 -04:00
parent 79e33899a8
commit ef8af7d618
3 changed files with 10 additions and 4 deletions

View File

@@ -32,7 +32,10 @@ def create():
dictify_range=dictify_range, default_converter=default_converter,
)
with open(os.path.join(target_folder, game_name + ".yaml"), "w") as f:
if not os.path.isdir(os.path.join(target_folder, 'configs')):
os.mkdir(os.path.join(target_folder, 'configs'))
with open(os.path.join(target_folder, 'configs', game_name + ".yaml"), "w") as f:
f.write(res)
# Generate JSON files for player-settings pages
@@ -78,5 +81,8 @@ def create():
player_settings["gameOptions"] = game_options
with open(os.path.join(target_folder, game_name + ".json"), "w") as f:
if not os.path.isdir(os.path.join(target_folder, 'player-settings')):
os.mkdir(os.path.join(target_folder, 'player-settings'))
with open(os.path.join(target_folder, 'player-settings', game_name + ".json"), "w") as f:
f.write(json.dumps(player_settings, indent=2, separators=(',', ': ')))