Skip to content

Commit 90300e9

Browse files
committed
Fix issue when initializing new config file if one already exists
1 parent eb82eb8 commit 90300e9

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

configuration/configuration.go

+2-17
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,10 @@ func FindConfigFile() string {
198198
}
199199

200200
if configFile != "" {
201-
if fi, err := os.Stat(configFile); err == nil {
202-
if fi.IsDir() {
203-
return configFile
204-
}
205-
return filepath.Dir(configFile)
206-
}
201+
return filepath.Dir(configFile)
207202
}
208203

209-
return searchCwdForConfig()
204+
return ""
210205
}
211206

212207
func searchConfigTree(cwd string) string {
@@ -230,13 +225,3 @@ func searchConfigTree(cwd string) string {
230225
}
231226

232227
}
233-
234-
func searchCwdForConfig() string {
235-
cwd, err := os.Getwd()
236-
237-
if err != nil {
238-
return ""
239-
}
240-
241-
return searchConfigTree(cwd)
242-
}

0 commit comments

Comments
 (0)