From 7deaa00d6e7b129f96fc24a0ff5081637131f94f Mon Sep 17 00:00:00 2001 From: notplants Date: Fri, 20 May 2022 13:31:06 +0200 Subject: [PATCH] Fix hardcoded path --- peach-lib/src/sbot.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 880479d..12cb57c 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -199,9 +199,8 @@ impl Default for SbotConfig { impl SbotConfig { /// Read the go-sbot `config.toml` file from file and deserialize into `SbotConfig`. pub fn read() -> Result { - // determine path of user's home directory - let mut config_path = dirs::home_dir().ok_or(PeachError::HomeDir)?; - config_path.push(".ssb-go/config.toml"); + // determine path of user's go-sbot config.toml + let config_path = format!("{}/config.toml", get_config_value("GO_SBOT_DATADIR")?); let config_contents = fs::read_to_string(config_path)?; @@ -217,7 +216,7 @@ impl SbotConfig { // convert the provided `SbotConfig` instance to a string let config_string = toml::to_string(&config)?; - // determine path of user's home directory + // determine path of user's go-sbot config.toml let config_path = format!("{}/config.toml", get_config_value("GO_SBOT_DATADIR")?); // open config file for writing