From 005a5e5fb80962401884b94062bed08fa1d616f1 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 7 Jan 2022 15:38:34 +0800 Subject: [PATCH] change: RunE => Run --- hrp/cmd/run.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hrp/cmd/run.go b/hrp/cmd/run.go index 93423094..29aa2486 100644 --- a/hrp/cmd/run.go +++ b/hrp/cmd/run.go @@ -1,6 +1,8 @@ package cmd import ( + "os" + "github.com/spf13/cobra" "github.com/httprunner/hrp" @@ -18,7 +20,7 @@ var runCmd = &cobra.Command{ PreRun: func(cmd *cobra.Command, args []string) { setLogLevel(logLevel) }, - RunE: func(cmd *cobra.Command, args []string) error { + Run: func(cmd *cobra.Command, args []string) { var paths []hrp.ITestCase for _, arg := range args { paths = append(paths, &hrp.TestCasePath{Path: arg}) @@ -29,7 +31,10 @@ var runCmd = &cobra.Command{ if proxyUrl != "" { runner.SetProxyUrl(proxyUrl) } - return runner.Run(paths...) + err := runner.Run(paths...) + if err != nil { + os.Exit(1) + } }, }