Skip to content

Commit

Permalink
fix(template): fix "parent folder does not exist" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
InioX committed Dec 3, 2023
1 parent d0da60f commit 2abebd1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/util/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ impl Template {
name,
output_path_absolute.display()
);

let parent_folder = &output_path_absolute
.parent()
.wrap_err("Could not get the parent of the output path.")?;

if !output_path_absolute.exists() {
if !parent_folder.exists() {
error!(
"The <b><yellow>{}</> folder doesnt exist, trying to create...",
&output_path_absolute.display()
&parent_folder.display()
);
let parent_folder = &output_path_absolute
.parent()
.wrap_err("Could not get the parent of the output path.")?;
debug!("{}", parent_folder.display());
let _ = create_dir_all(parent_folder).wrap_err(format!(
"Failed to create the {} folders.",
Expand Down

0 comments on commit 2abebd1

Please sign in to comment.