From bfce94ce94c79c809958285bf6929ca1ac60fc7c Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 9 Dec 2019 20:33:21 -0700 Subject: [PATCH 1/2] RepoConfig: Use empty HashMap default for subsets SubsetConfig isn't even used currently, so provide a default empty HashMap from serde so it isn't required in configuration. --- src/app.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app.rs b/src/app.rs index a2bf01b..839b0a4 100644 --- a/src/app.rs +++ b/src/app.rs @@ -209,6 +209,7 @@ pub struct RepoConfig { pub gpg_key_content: Option, pub base_url: Option, pub runtime_repo_url: Option, + #[serde(default)] pub subsets: HashMap, pub post_publish_script: Option, #[serde(default)] From 4887242d2dbe664edc713ad96f339d120a8f3f7e Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 9 Dec 2019 20:40:22 -0700 Subject: [PATCH 2/2] Config: Default build-repo-base to "build-repo" This matches the example configuration. --- src/app.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app.rs b/src/app.rs index 839b0a4..44093b0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -230,6 +230,10 @@ fn default_numcpu() -> u32 { num_cpus::get() as u32 } +fn default_build_repo_base() -> PathBuf { + PathBuf::from("build-repo") +} + #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "kebab-case", deny_unknown_fields)] pub struct Config { @@ -246,6 +250,7 @@ pub struct Config { #[serde(default, deserialize_with = "from_opt_base64")] pub repo_secret: Option>, pub repos: HashMap, + #[serde(default = "default_build_repo_base")] pub build_repo_base: PathBuf, pub build_gpg_key: Option, #[serde(skip)]