chiark / gitweb /
improve bundled-sources check
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Nov 2020 11:05:14 +0000 (11:05 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Nov 2020 11:05:14 +0000 (11:05 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/daemon-otter.rs

index 86db3341b7af25c04ca05135d15c0c55a429390d..8dfe694c857812dc7b2b63342af624c703da6830 100644 (file)
@@ -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);