Only create config-directory on init success

We should only create the file if the user finished the initial setup correctly.
pull/481/head
Daniel Karzel 3 years ago
parent d96e20a5b0
commit 538b25a6dd
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E

@ -123,10 +123,11 @@ where
F: Fn() -> Result<Config>,
{
info!("Config file not found, running initial setup...");
ensure_directory_exists(config_path.as_path())?;
let initial_config = config_file()?;
let toml = toml::to_string(&initial_config)?;
ensure_directory_exists(config_path.as_path())?;
fs::write(&config_path, toml)?;
info!(

Loading…
Cancel
Save