"#194 Added trash switch checked before normal rm command action"
@@ -944,16 +944,14 @@ impl Shell for FilesystemShell {
));
}
- if path.is_dir() {
- std::fs::remove_dir_all(&path)?;
- } else if path.is_file() {
if trash.item {
SendToTrash::remove(path).unwrap();
- } else {
+ } else if path.is_dir() {
+ std::fs::remove_dir_all(&path)?;
+ } else if path.is_file() {
std::fs::remove_file(&path)?;
}
}
- }
Err(e) => {
return Err(ShellError::labeled_error(
format!("Remove aborted. {:}", e.to_string()),
