From: Ian Jackson Date: Sun, 6 Sep 2020 23:07:04 +0000 (+0100) Subject: check bundled_sources exist X-Git-Tag: otter-0.2.0~978 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=40f2bc30921d138d4d039c0e866e117d766939dd;p=otter.git check bundled_sources exist --- diff --git a/server.toml b/server.toml index 81e72ce3..4426726f 100644 --- a/server.toml +++ b/server.toml @@ -5,6 +5,7 @@ save_directory = "/home/rustcargo/Rustup/Game/server" template_dir = "/home/ian/Rustup/Game/server/templates" +bundled_sources = "/home/rustcargo/Rustup/Game/server/target/bundled-sources" [log] global_level = 'debug' diff --git a/src/bin/server.rs b/src/bin/server.rs index fa5ee02f..9698194a 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -83,6 +83,11 @@ fn main() { flexi_logger::Logger::with(c.log.clone()).start()?; + let bundled_sources = &c.bundled_sources; + fs::metadata(format!("{}/index.html", bundled_sources)) + .with_context(||bundled_sources.clone()) + .context("check bundled-sources directory's index.html")?; + load_games()?; let cl = CommandListener::new()?;