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
parent
commit
c4363c4b5e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      weed/shell/command_fs_rm.go

8
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) { func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
isRecursive := false isRecursive := false
ignoreRecursiveError := false ignoreRecursiveError := false
var entiries []string
var entries []string
for _, arg := range args { for _, arg := range args {
if !strings.HasPrefix(arg, "-") { if !strings.HasPrefix(arg, "-") {
entiries = append(entiries, arg)
entries = append(entries, arg)
continue continue
} }
for _, t := range arg { 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") return fmt.Errorf("need to have arguments")
} }
commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { commandEnv.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
for _, entry := range entiries {
for _, entry := range entries {
targetPath, err := commandEnv.parseUrl(entry) targetPath, err := commandEnv.parseUrl(entry)
if err != nil { if err != nil {
fmt.Fprintf(writer, "rm: %s: %v\n", targetPath, err) fmt.Fprintf(writer, "rm: %s: %v\n", targetPath, err)

Loading…
Cancel
Save