Skip to content

Commit

Permalink
Create to dir if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Jul 13, 2023
1 parent e56228e commit f182518
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/huak_ops/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ pub fn copy_dir<T: AsRef<Path>>(
let from = from.as_ref();
let to = to.as_ref();

if !to.exists() {
fs::create_dir(to)?;
}

if from.is_dir() {
for entry in fs::read_dir(from)?.filter_map(|e| e.ok()) {
let entry_path = entry.path();
Expand Down

0 comments on commit f182518

Please sign in to comment.