From 2a74254914996f815e22952e3ecf5a655a46807d Mon Sep 17 00:00:00 2001 From: anis Date: Sun, 24 Nov 2024 13:39:58 +0100 Subject: [PATCH] ensured locale/lang exists --- compare_tools/format_output.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compare_tools/format_output.py b/compare_tools/format_output.py index fb0279b..69c5d2e 100644 --- a/compare_tools/format_output.py +++ b/compare_tools/format_output.py @@ -2,6 +2,7 @@ from compare_tools.Mod import Mod from compare_tools.compare_configs import compare_configs from configparser import ConfigParser +import os TEXT_DISPLAYED = { "added_keys": "These keys were added since last update", @@ -21,6 +22,9 @@ def format_output(config_json, mod): # Write the file section by section starting with the common ones path = "output/" + mod.name + "/locale.cfg" + if not os.path.exists("output/" + mod.name): + os.makedirs("output/" + mod.name) + with open(path, "w+") as f: # added_sections for sections in "added_sections", "removed_sections":