From: Ian Jackson Date: Sat, 14 May 2022 13:52:42 +0000 (+0100) Subject: nwtemplates: Log a warning if there are no templates X-Git-Tag: otter-1.1.0~190 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3cdba32d1b105d120e6f5f8ba2e69b25d0740d8c;p=otter.git nwtemplates: Log a warning if there are no templates This is probably an installation or usage error. Reporting that helps if subsequently a template isn't found. Signed-off-by: Ian Jackson --- diff --git a/src/nwtemplates.rs b/src/nwtemplates.rs index b49062e4..a492bddf 100644 --- a/src/nwtemplates.rs +++ b/src/nwtemplates.rs @@ -25,6 +25,11 @@ pub fn init() { .context("load tamplates") .with_context(|| nwtemplate_dir.to_string())?; + if tera.get_template_names().next().is_none() { + warn!("nwtemplates directory {:?} contains no templates!", + nwtemplate_dir); + } + *guard = Some(State { tera, })