From ab5c623ac73c595c00d18aaf4da0e06e63467f51 Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Tue, 5 Nov 2019 06:01:26 -0800 Subject: [PATCH] cli: should return non-zero code for error (#3469) --- pkg/process/exec_conf.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/process/exec_conf.go b/pkg/process/exec_conf.go index 0ab8526d7..016d711eb 100644 --- a/pkg/process/exec_conf.go +++ b/pkg/process/exec_conf.go @@ -71,7 +71,10 @@ func Exec(cmd *cobra.Command) { pflag.CommandLine.AddGoFlagSet(flag.CommandLine) cleanup(cmd) - _ = cmd.Execute() + err = cmd.Execute() + if err != nil { + os.Exit(1) + } } // Ctx returns the appropriate context.Context for ExecuteWithConfig commands