MCPcopy
hub / github.com/urfave/cli / runBefore

Function runBefore

command_run.go:400–412  ·  view source on GitHub ↗
(ctx context.Context, cmdChain []*Command)

Source from the content-addressed store, hash-verified

398}
399
400func runBefore(ctx context.Context, cmdChain []*Command) (context.Context, error) {
401 for _, cmd := range cmdChain {
402 if cmd.Before == nil {
403 continue
404 }
405 if bctx, err := cmd.Before(ctx, cmd); err != nil {
406 return ctx, cmd.handleExitCoder(ctx, err)
407 } else if bctx != nil {
408 ctx = bctx
409 }
410 }
411 return ctx, nil
412}

Callers 1

runMethod · 0.85

Calls 1

handleExitCoderMethod · 0.80

Tested by

no test coverage detected