From 45747ce53fb9db40cf943d6db3954f66536ed3f8 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 1 Jul 2024 02:50:43 -0500 Subject: [PATCH] recursively create config directory too --- src/config.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config.rs b/src/config.rs index 1118d5a..9471dee 100644 --- a/src/config.rs +++ b/src/config.rs @@ -334,6 +334,9 @@ impl Config { if !config_path.exists() { info!("No config found, creating one at {config_path:?}"); let default_config_str = include_str!("../config-default.toml"); + if let Some(parent_path) = config_path.parent() { + let _ = fs::create_dir_all(parent_path); + } fs::write(config_path, default_config_str)?; }