Do not double print errors from Before()
They should be handled by HandleExitCoder() as `After()` errors are.
This commit is contained in:
@@ -197,8 +197,6 @@ func (c Command) Run(ctx *Context) (err error) {
|
||||
if c.Before != nil {
|
||||
err = c.Before(context)
|
||||
if err != nil {
|
||||
fmt.Fprintln(context.App.Writer, err)
|
||||
fmt.Fprintln(context.App.Writer)
|
||||
ShowCommandHelp(context, c.Name)
|
||||
HandleExitCoder(err)
|
||||
return err
|
||||
|
Reference in New Issue
Block a user