forked from extern/nushell
rm: don't update target_exists every time in the loop (#6837)
This commit is contained in:
parent
b2c29117d9
commit
c6436eb32f
@ -231,10 +231,12 @@ fn rm(
|
|||||||
) {
|
) {
|
||||||
Ok(files) => {
|
Ok(files) => {
|
||||||
for file in files {
|
for file in files {
|
||||||
target_exists = true;
|
|
||||||
|
|
||||||
match file {
|
match file {
|
||||||
Ok(ref f) => {
|
Ok(ref f) => {
|
||||||
|
if !target_exists {
|
||||||
|
target_exists = true;
|
||||||
|
}
|
||||||
|
|
||||||
// It is not appropriate to try and remove the
|
// It is not appropriate to try and remove the
|
||||||
// current directory or its parent when using
|
// current directory or its parent when using
|
||||||
// glob patterns.
|
// glob patterns.
|
||||||
|
Loading…
Reference in New Issue
Block a user