File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ func hookCreate(confPath string, isReplace bool) error {
47
47
}
48
48
49
49
// configCreate is the callback function for create config command
50
- func configCreate (isReplace bool ) error {
50
+ func configCreate (fileName string , isReplace bool ) error {
51
51
defConf := config .Default ()
52
- outPath := filepath .Join ("." , config . ConfigFile )
52
+ outPath := filepath .Join ("." , fileName )
53
53
// if config file already exists skip creating or overwriting it
54
54
if _ , err := os .Stat (outPath ); ! os .IsNotExist (err ) {
55
55
if ! isReplace {
Original file line number Diff line number Diff line change @@ -105,10 +105,16 @@ func configCmd() *cli.Command {
105
105
Usage : "Replace conf file if already exists" ,
106
106
Value : false ,
107
107
},
108
+ & cli.StringFlag {
109
+ Name : "file" ,
110
+ Usage : "Config file name" ,
111
+ Value : ".commitlint.yaml" ,
112
+ },
108
113
},
109
114
Action : func (ctx * cli.Context ) error {
110
115
isReplace := ctx .Bool ("replace" )
111
- err := configCreate (isReplace )
116
+ fileName := ctx .String ("file" )
117
+ err := configCreate (fileName , isReplace )
112
118
if err != nil {
113
119
if isConfExists (err ) {
114
120
fmt .Println ("config create failed" )
You can’t perform that action at this time.
0 commit comments