recursively create config directory too
This commit is contained in:
parent
2fd44599e2
commit
45747ce53f
@ -334,6 +334,9 @@ impl Config {
|
|||||||
if !config_path.exists() {
|
if !config_path.exists() {
|
||||||
info!("No config found, creating one at {config_path:?}");
|
info!("No config found, creating one at {config_path:?}");
|
||||||
let default_config_str = include_str!("../config-default.toml");
|
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)?;
|
fs::write(config_path, default_config_str)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user