From 9d2448d47f3c8c860b3786524e241345cea230e7 Mon Sep 17 00:00:00 2001 From: Brent Scriver Date: Wed, 18 Sep 2024 21:17:17 -0400 Subject: [PATCH] Ensure the GameDefinitions/Generated directory exists before writing. --- BG3Extender/make_enumerations.py | 2 ++ BG3Extender/make_property_map.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/BG3Extender/make_enumerations.py b/BG3Extender/make_enumerations.py index c208dac5b..6d09a7315 100644 --- a/BG3Extender/make_enumerations.py +++ b/BG3Extender/make_enumerations.py @@ -72,6 +72,8 @@ def preprocess_line(self, line): cur_enumerations = '' try: + if not os.path.exists('GameDefinitions/Generated'): + os.mkdir('GameDefinitions/Generated') with open('GameDefinitions/Generated/Enumerations.inl', 'r') as f: cur_enumerations = f.read() except FileNotFoundError: diff --git a/BG3Extender/make_property_map.py b/BG3Extender/make_property_map.py index a66c0ad40..d1e0a37cc 100644 --- a/BG3Extender/make_property_map.py +++ b/BG3Extender/make_property_map.py @@ -699,6 +699,9 @@ def preprocess_line(self, line): except FileNotFoundError: pass +if not os.path.exists('GameDefinitions/Generated'): + os.mkdir('GameDefinitions/Generated') + if cur_names != propmap_names + preprocessor.names: with open('GameDefinitions/Generated/PropertyMapNames.inl', 'w') as f: f.write(propmap_names + preprocessor.names)