From 3cdba32d1b105d120e6f5f8ba2e69b25d0740d8c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 14 May 2022 14:52:42 +0100 Subject: [PATCH] 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 --- src/nwtemplates.rs | 5 +++++ 1 file changed, 5 insertions(+) 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, }) -- 2.30.2