Skip to content

Commit 4f77b2a

Browse files
committed
🐛 Fixed non-empty directory could remove by --unlink-first option
1 parent fec04be commit 4f77b2a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cli/src/command/extract.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ where
625625
OverwriteStrategy::Always | OverwriteStrategy::KeepNewer
626626
) && had_existing;
627627
if unlink_existing {
628-
utils::io::ignore_not_found(utils::fs::remove_path_all(&path))?;
628+
utils::io::ignore_not_found(utils::fs::remove_path(&path))?;
629629
}
630630

631631
if let Some(parent) = path.parent() {
@@ -678,7 +678,7 @@ where
678678
return Ok(());
679679
}
680680
if remove_existing {
681-
utils::io::ignore_not_found(utils::fs::remove_path_all(&path))?;
681+
utils::io::ignore_not_found(utils::fs::remove_path(&path))?;
682682
}
683683
utils::fs::symlink(original, &path)?;
684684
}
@@ -716,7 +716,7 @@ where
716716
original_path
717717
};
718718
if remove_existing {
719-
utils::io::ignore_not_found(utils::fs::remove_path_all(&path))?;
719+
utils::io::ignore_not_found(utils::fs::remove_path(&path))?;
720720
}
721721
fs::hard_link(original, &path)?;
722722
}

0 commit comments

Comments
 (0)