Merge pull request #401 from dosisod/autodetect-yml-files

Allow for autodetecting both `.yaml` and `.yml` config files
This commit is contained in:
Alex Goodman 2023-07-06 10:25:48 -04:00 committed by GitHub
commit e2d9b623f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}
}