Merge pull request #1610 from technosophos/fix/1609-plugin-command-panic

fix(helm): handle errors when plugin command is not found
pull/1621/head
Matt Butcher 8 years ago committed by GitHub
commit ac628a82cf

@ -78,9 +78,11 @@ func loadPlugins(baseCmd *cobra.Command, home helmpath.Home, out io.Writer) {
prog.Stdout = out
prog.Stderr = os.Stderr
if err := prog.Run(); err != nil {
eerr := err.(*exec.ExitError)
os.Stderr.Write(eerr.Stderr)
return fmt.Errorf("plugin %q exited with error", md.Name)
if eerr, ok := err.(*exec.ExitError); ok {
os.Stderr.Write(eerr.Stderr)
return fmt.Errorf("plugin %q exited with error", md.Name)
}
return err
}
return nil
},

Loading…
Cancel
Save