From 3ff9e71bc85944d9257c31ac04a3208769d86590 Mon Sep 17 00:00:00 2001 From: Dmitriy Gertsog Date: Tue, 26 Nov 2024 19:05:32 +0300 Subject: [PATCH] config: Find yaml config if input no extension Function util.GetYamlFileName let's search config if input argument does not have any extension, also. --- cli/util/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/util/util.go b/cli/util/util.go index 6eb473635..44de0ab22 100644 --- a/cli/util/util.go +++ b/cli/util/util.go @@ -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) }