mirror of https://github.com/docker/cli.git
Fix a panic when the DOCKER_HOST was invalid using cobra commands.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
8ad9f66953
commit
55d46e8352
|
@ -71,7 +71,9 @@ func (c CobraAdaptor) Usage() []cli.Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c CobraAdaptor) run(cmd string, args []string) error {
|
func (c CobraAdaptor) run(cmd string, args []string) error {
|
||||||
c.dockerCli.Initialize()
|
if err := c.dockerCli.Initialize(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
// Prepend the command name to support normal cobra command delegation
|
// Prepend the command name to support normal cobra command delegation
|
||||||
c.rootCmd.SetArgs(append([]string{cmd}, args...))
|
c.rootCmd.SetArgs(append([]string{cmd}, args...))
|
||||||
return c.rootCmd.Execute()
|
return c.rootCmd.Execute()
|
||||||
|
|
Loading…
Reference in New Issue