mirror of
https://github.com/spf13/cobra
synced 2025-04-22 06:37:19 +00:00
Merge 81a7781237
into ceb39aba25
This commit is contained in:
commit
64367265c7
1 changed files with 2 additions and 5 deletions
|
@ -1139,11 +1139,8 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||||
cmd.commandCalledAs.name = cmd.Name()
|
cmd.commandCalledAs.name = cmd.Name()
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have to pass global context to children command
|
// Copy context
|
||||||
// if context is present on the parent command.
|
cmd.ctx = c.ctx
|
||||||
if cmd.ctx == nil {
|
|
||||||
cmd.ctx = c.ctx
|
|
||||||
}
|
|
||||||
|
|
||||||
err = cmd.execute(flags)
|
err = cmd.execute(flags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue