From 7bbcc3b99b3ce455f62e8c8917ded411380975df Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Thu, 29 Feb 2024 19:53:21 +0100 Subject: [PATCH] Update confy to show the configuration path With the older version (v0.4.0) there was no possibility to show the configuration path to the user, who therefore had to hunt for its location. By updating it, this path can now be shown during loading and storing. Signed-off-by: Jacob Kiers --- Cargo.toml | 2 +- src/lib.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 835813f..ce359fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] anyhow = "1.0.32" base64 = "0.12.3" -confy = "0.4.0" +confy = "0.6.0" dotenv = "0.15.0" isahc = { version = "0.9.8", features = ["json"] } rand = "0.8.5" diff --git a/src/lib.rs b/src/lib.rs index b678a28..b3ca44a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,10 +122,12 @@ pub struct BunqConfigReady { impl BunqConfig { pub fn load() -> Result { - Ok(confy::load("bunq-rs")?) + println!("Loading config file from {}", confy::get_configuration_file_path("bunq-rs", "bunq-rs")?.to_string_lossy()); + Ok(confy::load("bunq-rs", "bunq-rs")?) } pub fn save(&self) -> Result<()> { - confy::store("bunq-rs", self)?; + println!("Storing config file in {}", confy::get_configuration_file_path("bunq-rs", None)?.to_string_lossy()); + confy::store("bunq-rs", "bunq-rs", self)?; Ok(()) } pub fn install(mut self) -> Result {