Fix hardcoded path
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
notplants 2022-05-20 13:31:06 +02:00
parent 8960df6635
commit 7deaa00d6e
1 changed files with 3 additions and 4 deletions

View File

@ -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<Self, PeachError> {
// 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