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( observer.schedule(
event_handler, path=str(root / "content"), recursive=True event_handler, path=str(root / "content"), recursive=True
) )
observer.schedule( templates = root / "templates"
event_handler, if templates.is_dir():
path=str(root / "templates"), observer.schedule(
recursive=True, event_handler,
) path=str(templates),
recursive=True,
)
observer.start() observer.start()
# function to shut down gracefully # function to shut down gracefully