From ad477602cdf8b177d799700e4d484924874f1480 Mon Sep 17 00:00:00 2001 From: Fabien Lelaquais <86590727+FabienLelaquais@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:55:23 +0200 Subject: [PATCH] Test for proper retrieval of Designer (#1143) --- tools/_setup_generation/step_designer.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/_setup_generation/step_designer.py b/tools/_setup_generation/step_designer.py index 3fd278ffa..b37652dbf 100644 --- a/tools/_setup_generation/step_designer.py +++ b/tools/_setup_generation/step_designer.py @@ -26,15 +26,16 @@ def get_description(self) -> str: def setup(self, setup: Setup): ... def enter(self, setup: Setup): - self.DESIGNER_PATH = os.path.join( - setup.docs_dir, *DesignerStep.PREFIX.split("/") - ) - self.MKDOCS_TMPL = os.path.join(self.DESIGNER_PATH, "mkdocs.yml_template") - if not os.access(self.MKDOCS_TMPL, os.R_OK): - raise FileNotFoundError( - f"FATAL - Could not read docs/{DesignerStep.PREFIX}/mkdocs.yml_template" + if os.path.exists(os.path.join(setup.docs_dir, DesignerStep.PREFIX)): + self.DESIGNER_PATH = os.path.join( + setup.docs_dir, *DesignerStep.PREFIX.split("/") ) - self.navigation = self._read_mkdocs_template() + self.MKDOCS_TMPL = os.path.join(self.DESIGNER_PATH, "mkdocs.yml_template") + if not os.access(self.MKDOCS_TMPL, os.R_OK): + raise FileNotFoundError( + f"FATAL - Could not read docs/{DesignerStep.PREFIX}/mkdocs.yml_template" + ) + self.navigation = self._read_mkdocs_template() def exit(self, setup: Setup): setup.update_mkdocs_yaml_template(