We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14d83c0 commit fec04beCopy full SHA for fec04be
1 file changed
cli/src/command/extract.rs
@@ -586,7 +586,7 @@ where
586
Err(err) if err.kind() == io::ErrorKind::NotFound => None,
587
Err(err) => return Err(err),
588
};
589
- if let Some(existing) = metadata.as_ref() {
+ if let Some(existing) = &metadata {
590
match overwrite_strategy {
591
OverwriteStrategy::Never if !*unlink_first => {
592
return Err(io::Error::new(
@@ -631,6 +631,11 @@ where
631
if let Some(parent) = path.parent() {
632
ensure_directory_components(parent, *unlink_first)?;
633
}
634
+ if let Some(meta) = metadata {
635
+ if meta.is_symlink() || (meta.is_file() && entry_kind == DataKind::Directory) {
636
+ utils::io::ignore_not_found(utils::fs::remove_path(&path))?;
637
+ }
638
639
640
let remove_existing = should_overwrite_existing && !unlink_existing;
641
0 commit comments