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