fixed crash on missing templates dir when starting server

This commit is contained in:
Daniel Fichtinger 2025-07-14 19:19:58 -04:00
parent 404e951651
commit 933210c93b

View file

@ -237,11 +237,13 @@ def serve(
observer.schedule(
event_handler, path=str(root / "content"), recursive=True
)
observer.schedule(
event_handler,
path=str(root / "templates"),
recursive=True,
)
templates = root / "templates"
if templates.is_dir():
observer.schedule(
event_handler,
path=str(templates),
recursive=True,
)
observer.start()
# function to shut down gracefully