Skip to content

Commit

Permalink
reorder some operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jharshman authored and spf13 committed Jun 7, 2019
1 parent 732e4db commit b8ad19a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cobra/cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ Example: cobra add server -> resulting in a new cmd/server.go`,
er("add needs a name for the command")
}

commandName := validateCmdName(args[0])

if packageName == "" {
// derive packageName
}

wd, err := os.Getwd()
if err != nil {
er(err)
}

commandName := validateCmdName(args[0])
command := &Command{
CmdName: commandName,
CmdParent: parentName,
Expand Down

0 comments on commit b8ad19a

Please sign in to comment.