Skip to content

Commit

Permalink
Test for proper retrieval of Designer (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienLelaquais authored Oct 2, 2024
1 parent f6e91d7 commit ad47760
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tools/_setup_generation/step_designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ad47760

Please sign in to comment.