fix(exit code): fix the return exit code 0 if subcommand excuted failed

Close: #8286

Signed-off-by: Dong Gang <dong.gang@daocloud.io>
pull/8511/head
Dong Gang 5 years ago
parent d481bc6cf3
commit 52c2335b71

@ -89,6 +89,7 @@ func newDependencyCmd(out io.Writer) *cobra.Command {
Short: "manage a chart's dependencies", Short: "manage a chart's dependencies",
Long: dependencyDesc, Long: dependencyDesc,
Args: require.NoArgs, Args: require.NoArgs,
Run: func(cmd *cobra.Command, args []string) {},
} }
cmd.AddCommand(newDependencyListCmd(out)) cmd.AddCommand(newDependencyListCmd(out))

@ -41,6 +41,7 @@ func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
Short: "download extended information of a named release", Short: "download extended information of a named release",
Long: getHelp, Long: getHelp,
Args: require.NoArgs, Args: require.NoArgs,
Run: func(cmd *cobra.Command, args []string) {},
} }
cmd.AddCommand(newGetAllCmd(cfg, out)) cmd.AddCommand(newGetAllCmd(cfg, out))

@ -35,6 +35,7 @@ func newPluginCmd(out io.Writer) *cobra.Command {
Use: "plugin", Use: "plugin",
Short: "install, list, or uninstall Helm plugins", Short: "install, list, or uninstall Helm plugins",
Long: pluginHelp, Long: pluginHelp,
Run: func(cmd *cobra.Command, args []string) {},
} }
cmd.AddCommand( cmd.AddCommand(
newPluginInstallCmd(out), newPluginInstallCmd(out),

@ -38,6 +38,7 @@ func newRepoCmd(out io.Writer) *cobra.Command {
Short: "add, list, remove, update, and index chart repositories", Short: "add, list, remove, update, and index chart repositories",
Long: repoHelm, Long: repoHelm,
Args: require.NoArgs, Args: require.NoArgs,
Run: func(cmd *cobra.Command, args []string) {},
} }
cmd.AddCommand(newRepoAddCmd(out)) cmd.AddCommand(newRepoAddCmd(out))

@ -34,6 +34,7 @@ func newSearchCmd(out io.Writer) *cobra.Command {
Use: "search [keyword]", Use: "search [keyword]",
Short: "search for a keyword in charts", Short: "search for a keyword in charts",
Long: searchDesc, Long: searchDesc,
Run: func(cmd *cobra.Command, args []string) {},
} }
cmd.AddCommand(newSearchHubCmd(out)) cmd.AddCommand(newSearchHubCmd(out))

@ -60,6 +60,7 @@ func newShowCmd(out io.Writer) *cobra.Command {
Aliases: []string{"inspect"}, Aliases: []string{"inspect"},
Long: showDesc, Long: showDesc,
Args: require.NoArgs, Args: require.NoArgs,
Run: func(cmd *cobra.Command, args []string) {},
} }
// Function providing dynamic auto-completion // Function providing dynamic auto-completion

Loading…
Cancel
Save