From 94366382efdb43c608a561a606829287d9b32ba1 Mon Sep 17 00:00:00 2001 From: openset Date: Tue, 19 Mar 2019 17:39:46 +0800 Subject: [PATCH 1/2] Update: CheckErr --- internal/base/base.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/base/base.go b/internal/base/base.go index 141fb6243..86ec0f34b 100644 --- a/internal/base/base.go +++ b/internal/base/base.go @@ -89,12 +89,13 @@ func getFilePath(filename string) string { func CheckErr(err error) { if err != nil { - panic(err) + fmt.Println(err.Error()) + Exit() } } func Exit() { - os.Exit(0) + os.Exit(1) } func AuthInfo(cmd string) string { From 50a1611bfe9b9f140991369cab3371987634e2bc Mon Sep 17 00:00:00 2001 From: openset Date: Tue, 19 Mar 2019 17:41:34 +0800 Subject: [PATCH 2/2] Update: CmdHelper --- internal/helper/helper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/helper/helper.go b/internal/helper/helper.go index 59cc38816..7947d5922 100644 --- a/internal/helper/helper.go +++ b/internal/helper/helper.go @@ -22,8 +22,7 @@ func runHelper(cmd *base.Command, args []string) { buf.WriteString(base.AuthInfo("helper")) buf.WriteString("\n# Helper\n\n") buf.WriteString("```text\n") - out, err := exec.Command(base.CmdName).Output() - base.CheckErr(err) + out, _ := exec.Command(base.CmdName).Output() buf.Write(out) buf.WriteString("```\n") base.FilePutContents("helper/README.md", buf.Bytes())