From ba61ad2e43cc2a8e7ea490de5ff50d4365225cc0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 22 Nov 2020 11:05:14 +0000 Subject: [PATCH] improve bundled-sources check Signed-off-by: Ian Jackson --- src/bin/daemon-otter.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/daemon-otter.rs b/src/bin/daemon-otter.rs index 86db3341..8dfe694c 100644 --- a/src/bin/daemon-otter.rs +++ b/src/bin/daemon-otter.rs @@ -117,10 +117,12 @@ fn main() { flexi_logger::Logger::with(c.log.clone()).start()?; - let bundled_sources = &c.bundled_sources; - fs::metadata(format!("{}/", bundled_sources)) - .with_context(||bundled_sources.clone()) - .context("check bundled-sources directory")?; + { + let check = format!("{}/otter/index.html", &c.bundled_sources); + fs::metadata(&check) + .context(check.clone()) + .context("check bundled-sources directory")?; + } shapelib::load()?; @@ -177,7 +179,7 @@ fn main() { resource, updates, ]) - .mount("/_/src", StaticFiles::from(bundled_sources)) + .mount("/_/src", StaticFiles::from(&c.bundled_sources)) ; let r = otter::session::mount(r); -- 2.30.2