fix: Create the vaults file if it's not exist
Some checks failed
Rust CI / Rust CI (pull_request) Has been cancelled
Some checks failed
Rust CI / Rust CI (pull_request) Has been cancelled
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
parent
9a417e7d0b
commit
9578ec4e5f
1 changed files with 7 additions and 2 deletions
|
@ -122,11 +122,16 @@ impl Cli {
|
|||
log::info!("Using the given vaults file");
|
||||
if let Some(parent) = path.parent() {
|
||||
if parent.to_str() != Some("") && !parent.exists() {
|
||||
log::info!("Creating the parent vaults file directory");
|
||||
log::info!(
|
||||
"Creating the parent vaults file directory: {}",
|
||||
parent.display()
|
||||
);
|
||||
fs::create_dir_all(parent)?;
|
||||
}
|
||||
}
|
||||
fs::File::create(&path)?;
|
||||
if !path.exists() {
|
||||
fs::File::create(&path)?;
|
||||
}
|
||||
path
|
||||
} else {
|
||||
log::info!("Using the default vaults file");
|
||||
|
|
Loading…
Reference in a new issue