Skip to content

Commit 97a8ccf

Browse files
committed
improve checkout to look for config file in root directory
1 parent 43a0a79 commit 97a8ccf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/checkout/config.go

+8
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ func loadConfig() ([]list.Item, []list.Item, error) {
8484
}
8585
for {
8686
rel, _ := filepath.Rel(basePath, targetPath)
87+
fmt.Println("Rel:", rel)
8788
if rel == "." {
89+
filePath := filepath.Join(basePath, configFile)
90+
if _, err := os.Open(filePath); err == nil {
91+
fmt.Println("Found config file at", filePath)
92+
return loadConfigFile(filePath)
93+
}
8894
break
8995
}
9096
filePath := filepath.Join(targetPath, configFile)
@@ -93,6 +99,8 @@ func loadConfig() ([]list.Item, []list.Item, error) {
9399
return loadConfigFile(filePath)
94100
}
95101

102+
fmt.Println("No config file found at", filePath)
103+
96104
targetPath += "/.."
97105
}
98106
fmt.Println("No config file found, using default config")

0 commit comments

Comments
 (0)