|
|
@ -304,7 +304,7 @@ func (a *App) RunContext(ctx context.Context, arguments []string) (err error) {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if a.After != nil {
|
|
|
|
if a.After != nil && !cCtx.shellComplete {
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
if afterErr := a.After(cCtx); afterErr != nil {
|
|
|
|
if afterErr := a.After(cCtx); afterErr != nil {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -332,7 +332,7 @@ func (a *App) RunContext(ctx context.Context, arguments []string) (err error) {
|
|
|
|
return cerr
|
|
|
|
return cerr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if a.Before != nil {
|
|
|
|
if a.Before != nil && !cCtx.shellComplete {
|
|
|
|
beforeErr := a.Before(cCtx)
|
|
|
|
beforeErr := a.Before(cCtx)
|
|
|
|
if beforeErr != nil {
|
|
|
|
if beforeErr != nil {
|
|
|
|
a.handleExitCoder(cCtx, beforeErr)
|
|
|
|
a.handleExitCoder(cCtx, beforeErr)
|
|
|
@ -499,7 +499,7 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
|
|
|
|
return cerr
|
|
|
|
return cerr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if a.After != nil {
|
|
|
|
if a.After != nil && !cCtx.shellComplete {
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
afterErr := a.After(cCtx)
|
|
|
|
afterErr := a.After(cCtx)
|
|
|
|
if afterErr != nil {
|
|
|
|
if afterErr != nil {
|
|
|
@ -513,7 +513,7 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if a.Before != nil {
|
|
|
|
if a.Before != nil && !cCtx.shellComplete {
|
|
|
|
beforeErr := a.Before(cCtx)
|
|
|
|
beforeErr := a.Before(cCtx)
|
|
|
|
if beforeErr != nil {
|
|
|
|
if beforeErr != nil {
|
|
|
|
a.handleExitCoder(cCtx, beforeErr)
|
|
|
|
a.handleExitCoder(cCtx, beforeErr)
|
|
|
|