From be98b85b216018ae28810a2245f8f2b871002e5e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Sep 2020 00:01:51 +0100 Subject: [PATCH] bundled_sources config --- src/global.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/global.rs b/src/global.rs index 71e050bb..3d09208d 100644 --- a/src/global.rs +++ b/src/global.rs @@ -973,6 +973,7 @@ pub struct ServerConfigSpec { pub rocket_workers: Option, pub template_dir: Option, pub log: Option, + pub bundled_sources: Option, } #[derive(Debug,Clone)] @@ -984,6 +985,7 @@ pub struct ServerConfig { pub rocket_workers: u16, pub template_dir: String, pub log: LogSpecification, + pub bundled_sources: String, } impl TryFrom for ServerConfig { @@ -992,7 +994,7 @@ impl TryFrom for ServerConfig { fn try_from(spec: ServerConfigSpec) -> ServerConfig { let ServerConfigSpec { save_directory, command_socket, debug, - http_port, rocket_workers, template_dir, log, + http_port, rocket_workers, template_dir, log, bundled_sources, } = spec; let save_directory = save_directory @@ -1026,9 +1028,12 @@ impl TryFrom for ServerConfig { let log = LogSpecification::from_toml(&log) .context("log specification")?; + let bundled_sources = bundled_sources + .unwrap_or_else(|| save_directory.clone()); + ServerConfig { save_directory, command_socket, debug, - http_port, rocket_workers, template_dir, log, + http_port, rocket_workers, template_dir, log, bundled_sources, } } } -- 2.30.2