Skip to content

Commit

Permalink
don't try to create target directory when it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jun 4, 2023
1 parent 2bc2cab commit c48e0f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,12 @@ impl RustwideBuilder {
let old_dir = target_dir.join("doc");
let new_dir = target_dir.join(target).join("doc");
debug!("rename {} to {}", old_dir.display(), new_dir.display());
std::fs::create_dir(target_dir.join(target))?;
{
let parent = new_dir.parent().unwrap();
if !parent.exists() {
std::fs::create_dir(target_dir.join(target))?;
}
}
std::fs::rename(old_dir, new_dir)?;
}

Expand Down

0 comments on commit c48e0f4

Please sign in to comment.