1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-09 00:09:14 +00:00
This commit is contained in:
AtricoSoftware 2025-03-21 21:50:56 -04:00 committed by GitHub
commit 64367265c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1139,11 +1139,8 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
cmd.commandCalledAs.name = cmd.Name()
}
// We have to pass global context to children command
// if context is present on the parent command.
if cmd.ctx == nil {
cmd.ctx = c.ctx
}
// Copy context
cmd.ctx = c.ctx
err = cmd.execute(flags)
if err != nil {