From: Ian Jackson Date: Sun, 22 Nov 2020 11:05:14 +0000 (+0000) Subject: improve bundled-sources check X-Git-Tag: otter-0.2.0~403 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ba61ad2e43cc2a8e7ea490de5ff50d4365225cc0;p=otter.git improve bundled-sources check Signed-off-by: Ian Jackson --- 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);