Allow for autodetecting both .yaml and .yml config files

This commit is contained in:
dosisod 2022-05-13 23:33:31 -07:00
parent c7d121b3d7
commit 4fad38207e
2 changed files with 3 additions and 1 deletions

View file

@ -275,3 +275,5 @@ dive will search for configs in the following locations:
- `$XDG_CONFIG_DIRS/dive/*.yaml`
- `~/.config/dive/*.yaml`
- `~/.dive.yaml`
`.yml` can be used instead of `.yaml` if desired.

View file

@ -205,7 +205,7 @@ func findInPath(pathTo string) string {
for _, file := range files {
filename := file.Name()
if path.Ext(filename) == ".yaml" {
if path.Ext(filename) == ".yaml" || path.Ext(filename) == ".yml" {
return path.Join(directory, filename)
}
}