nu-command/filesystem: fix rm .sock file (#5524)

This commit is contained in:
Herlon Aguiar 2022-05-13 02:25:21 +02:00 committed by GitHub
parent 53e35670ea
commit 32d1939a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,7 +301,7 @@ fn rm(
trash::delete(&f).map_err(|e: trash::Error| {
Error::new(ErrorKind::Other, format!("{:?}", e))
})
} else if metadata.is_file() {
} else if metadata.is_file() || is_socket || is_fifo {
std::fs::remove_file(&f)
} else {
std::fs::remove_dir_all(&f)