Skip to content

Commit

Permalink
config: Find yaml config if input no extension
Browse files Browse the repository at this point in the history
Function util.GetYamlFileName let's search config if input argument does
not have any extension, also.
  • Loading branch information
dmyger committed Nov 28, 2024
1 parent 084955f commit 3ff9e71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ func GetYamlFileName(fileName string, mustExist bool) (string, error) {
fileBaseName = strings.TrimSuffix(fileName, ".yaml")
case ".yml":
fileBaseName = strings.TrimSuffix(fileName, ".yml")
case ".":
fileBaseName = strings.TrimSuffix(fileName, ".")
case "":
fileBaseName = fileName
default:
return "", fmt.Errorf("provided file '%s' has no .yaml/.yml extension", fileName)
}
Expand Down

0 comments on commit 3ff9e71

Please sign in to comment.