From 32d1939a95ef1043679e64968d8817d0acbdb4c0 Mon Sep 17 00:00:00 2001 From: Herlon Aguiar Date: Fri, 13 May 2022 02:25:21 +0200 Subject: [PATCH] nu-command/filesystem: fix rm .sock file (#5524) --- crates/nu-command/src/filesystem/rm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/rm.rs b/crates/nu-command/src/filesystem/rm.rs index f9126a603..825fc1d5b 100644 --- a/crates/nu-command/src/filesystem/rm.rs +++ b/crates/nu-command/src/filesystem/rm.rs @@ -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)