File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 5
5
"encoding/json"
6
6
"fmt"
7
7
"io/ioutil"
8
+ "log"
8
9
"os"
9
10
"path"
10
11
"path/filepath"
@@ -53,8 +54,7 @@ func Usage() {
53
54
fmt .Printf ("\t %-11s \t %s\n " , cmd .Name (), cmd .Short )
54
55
}
55
56
}
56
- fmt .Printf ("\n Use \" %s help <command>\" for more information about a command." , CmdName )
57
- fmt .Println ()
57
+ fmt .Printf ("\n Use \" %s help <command>\" for more information about a command.\n " , CmdName )
58
58
Exit ()
59
59
}
60
60
@@ -92,13 +92,12 @@ func getFilePath(filename string) string {
92
92
93
93
func CheckErr (err error ) {
94
94
if err != nil {
95
- fmt .Println (err .Error ())
96
- Exit ()
95
+ log .Fatalln (err )
97
96
}
98
97
}
99
98
100
99
func Exit () {
101
- os .Exit (1 )
100
+ os .Exit (0 )
102
101
}
103
102
104
103
func AuthInfo (cmd string ) string {
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ func runHelper(cmd *base.Command, args []string) {
22
22
buf .WriteString (base .AuthInfo ("helper" ))
23
23
buf .WriteString ("\n # Helper\n \n " )
24
24
buf .WriteString ("```text\n " )
25
- out , _ := exec .Command (base .CmdName ).Output ()
25
+ out , err := exec .Command (base .CmdName ).Output ()
26
+ base .CheckErr (err )
26
27
buf .Write (out )
27
28
buf .WriteString ("```\n " )
28
29
base .FilePutContents ("helper/README.md" , buf .Bytes ())
You can’t perform that action at this time.
0 commit comments