Browse Source
refactor(command_fs_rm): `entiries` -> `entries` (#3670)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
Signed-off-by: Ryan Russell <git@ryanrussell.org>
pull/3673/head
Ryan Russell
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
weed/shell/command_fs_rm.go
|
|
@ -37,10 +37,10 @@ func (c *commandFsRm) Help() string { |
|
|
|
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { |
|
|
|
isRecursive := false |
|
|
|
ignoreRecursiveError := false |
|
|
|
var entiries []string |
|
|
|
var entries []string |
|
|
|
for _, arg := range args { |
|
|
|
if !strings.HasPrefix(arg, "-") { |
|
|
|
entiries = append(entiries, arg) |
|
|
|
entries = append(entries, arg) |
|
|
|
continue |
|
|
|
} |
|
|
|
for _, t := range arg { |
|
|
@ -52,12 +52,12 @@ func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if len(entiries) < 1 { |
|
|
|
if len(entries) < 1 { |
|
|
|
return fmt.Errorf("need to have arguments") |
|
|
|
} |
|
|
|
|
|
|
|
commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { |
|
|
|
for _, entry := range entiries { |
|
|
|
for _, entry := range entries { |
|
|
|
targetPath, err := commandEnv.parseUrl(entry) |
|
|
|
if err != nil { |
|
|
|
fmt.Fprintf(writer, "rm: %s: %v\n", targetPath, err) |
|
|
|