mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-06-24 14:50:38 -04:00
Only create config-directory on init success
We should only create the file if the user finished the initial setup correctly.
This commit is contained in:
parent
d96e20a5b0
commit
538b25a6dd
1 changed files with 2 additions and 1 deletions
|
@ -123,10 +123,11 @@ where
|
||||||
F: Fn() -> Result<Config>,
|
F: Fn() -> Result<Config>,
|
||||||
{
|
{
|
||||||
info!("Config file not found, running initial setup...");
|
info!("Config file not found, running initial setup...");
|
||||||
ensure_directory_exists(config_path.as_path())?;
|
|
||||||
let initial_config = config_file()?;
|
let initial_config = config_file()?;
|
||||||
|
|
||||||
let toml = toml::to_string(&initial_config)?;
|
let toml = toml::to_string(&initial_config)?;
|
||||||
|
|
||||||
|
ensure_directory_exists(config_path.as_path())?;
|
||||||
fs::write(&config_path, toml)?;
|
fs::write(&config_path, toml)?;
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue