mirror of https://github.com/spf13/cobra.git
Child command context is not updated when global context changed #2077
This commit is contained in:
parent
283e32d889
commit
b516e74458
|
@ -1108,7 +1108,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
|||
|
||||
// We have to pass global context to children command
|
||||
// if context is present on the parent command.
|
||||
if cmd.ctx == nil {
|
||||
if c.ctx != nil {
|
||||
cmd.ctx = c.ctx
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue