Fix hardcoded path
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
8960df6635
commit
7deaa00d6e
|
@ -199,9 +199,8 @@ impl Default for SbotConfig {
|
||||||
impl SbotConfig {
|
impl SbotConfig {
|
||||||
/// Read the go-sbot `config.toml` file from file and deserialize into `SbotConfig`.
|
/// Read the go-sbot `config.toml` file from file and deserialize into `SbotConfig`.
|
||||||
pub fn read() -> Result<Self, PeachError> {
|
pub fn read() -> Result<Self, PeachError> {
|
||||||
// determine path of user's home directory
|
// determine path of user's go-sbot config.toml
|
||||||
let mut config_path = dirs::home_dir().ok_or(PeachError::HomeDir)?;
|
let config_path = format!("{}/config.toml", get_config_value("GO_SBOT_DATADIR")?);
|
||||||
config_path.push(".ssb-go/config.toml");
|
|
||||||
|
|
||||||
let config_contents = fs::read_to_string(config_path)?;
|
let config_contents = fs::read_to_string(config_path)?;
|
||||||
|
|
||||||
|
@ -217,7 +216,7 @@ impl SbotConfig {
|
||||||
// convert the provided `SbotConfig` instance to a string
|
// convert the provided `SbotConfig` instance to a string
|
||||||
let config_string = toml::to_string(&config)?;
|
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")?);
|
let config_path = format!("{}/config.toml", get_config_value("GO_SBOT_DATADIR")?);
|
||||||
|
|
||||||
// open config file for writing
|
// open config file for writing
|
||||||
|
|
Loading…
Reference in New Issue