diff --git a/src/app/tests.rs b/src/app/tests.rs index 74bd169..073542c 100644 --- a/src/app/tests.rs +++ b/src/app/tests.rs @@ -50,7 +50,7 @@ fn applies_configuration() -> anyhow::Result<()> { path: folder_directory.path().to_owned(), name: Some("notes".to_owned()), folder_id: None, - capability_env: None, + capability_environment_variable: None, mode: crate::domain::FolderMode::ReceiveOnly, }], }; diff --git a/src/config.rs b/src/config.rs index 1af5bd8..5708af9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -29,7 +29,8 @@ pub struct ConfiguredFolder { pub(crate) path: PathBuf, pub(crate) name: Option, pub(crate) folder_id: Option, - pub(crate) capability_env: Option, + #[serde(rename = "capability_env")] + pub(crate) capability_environment_variable: Option, #[serde(default)] pub(crate) mode: FolderMode, } @@ -61,7 +62,7 @@ impl AppaConfig { pub fn capability(&self, folder: &ConfiguredFolder) -> anyhow::Result> { folder - .capability_env + .capability_environment_variable .as_ref() .map(|variable| match env::var(variable) { Ok(value) => Ok(value), @@ -78,7 +79,7 @@ impl AppaConfig { anyhow::bail!("unsupported Appa config version {}", self.version); } for folder in &self.folders { - if folder.folder_id.is_some() != folder.capability_env.is_some() { + if folder.folder_id.is_some() != folder.capability_environment_variable.is_some() { anyhow::bail!( "{} must set both folder_id and capability_env to create a joined folder", folder.path.display() @@ -95,7 +96,7 @@ impl ConfiguredFolder { path: folder.path.clone(), name: Some(folder.name.clone()), folder_id: None, - capability_env: None, + capability_environment_variable: None, mode: folder.mode, } }