Skip to content

Commit

Permalink
fix paste overwrite erroring when creating directories
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiyaa committed Oct 31, 2021
1 parent 28a798a commit 5b62956
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/io/io_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ pub fn recursive_copy(
}
let file_type = fs::symlink_metadata(src)?.file_type();
if file_type.is_dir() {
fs::create_dir(dest_buf.as_path())?;
match fs::create_dir(dest_buf.as_path()) {
Ok(_) => {},
e => if !options.overwrite {
return e;
},
}
for entry in fs::read_dir(src)? {
let entry = entry?;
let entry_path = entry.path();
Expand Down

0 comments on commit 5b62956

Please sign in to comment.