Skip to content

Commit a0fe22d

Browse files
author
Shuo
authored
Merge pull request #448 from openset/develop
Update: CheckErr
2 parents 964eeef + 50a1611 commit a0fe22d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/base/base.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ func getFilePath(filename string) string {
8989

9090
func CheckErr(err error) {
9191
if err != nil {
92-
panic(err)
92+
fmt.Println(err.Error())
93+
Exit()
9394
}
9495
}
9596

9697
func Exit() {
97-
os.Exit(0)
98+
os.Exit(1)
9899
}
99100

100101
func AuthInfo(cmd string) string {

internal/helper/helper.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ func runHelper(cmd *base.Command, args []string) {
2222
buf.WriteString(base.AuthInfo("helper"))
2323
buf.WriteString("\n# Helper\n\n")
2424
buf.WriteString("```text\n")
25-
out, err := exec.Command(base.CmdName).Output()
26-
base.CheckErr(err)
25+
out, _ := exec.Command(base.CmdName).Output()
2726
buf.Write(out)
2827
buf.WriteString("```\n")
2928
base.FilePutContents("helper/README.md", buf.Bytes())

0 commit comments

Comments
 (0)