Added call to create config directory

This commit is contained in:
TeeWallz
2023-06-01 20:27:32 +02:00
parent e2f12d7cab
commit 25ea8d99b9
+2
View File
@@ -91,6 +91,8 @@ fn load_default_config(config_file: &Path) -> Result<Config> {
} }
fn create_empty_config_file(config_file: &Path) -> Result<()> { fn create_empty_config_file(config_file: &Path) -> Result<()> {
std::fs::create_dir_all(config_file.parent().context("getting parent dir")?)
.context("creating parent dir")?;
std::fs::File::create(config_file).context("creating empty config file")?; std::fs::File::create(config_file).context("creating empty config file")?;
Ok(()) Ok(())
} }