From 78358f58e72b3e517d8f1f918afe638f27c77e8f Mon Sep 17 00:00:00 2001 From: Aurelie Vache Date: Tue, 25 Jan 2022 16:03:47 +0100 Subject: [PATCH] feat: allows venom CLI tu support both .yml and .yaml extensions during venom run default command (#495) Signed-off-by: scraly --- process_files.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/process_files.go b/process_files.go index b7e9399a..648363d6 100644 --- a/process_files.go +++ b/process_files.go @@ -25,7 +25,8 @@ func getFilesPath(path []string) (filePaths []string, err error) { // if we put ./test/*.yml, it will fail and it's normal fileInfo, _ := os.Stat(p) if fileInfo != nil && fileInfo.IsDir() { - p = p + string(os.PathSeparator) + "*.yml" + //check if *.yml or *.yaml files exists in the path + p = p + string(os.PathSeparator) + "*.y*ml" } fpaths, err := zglob.Glob(p) @@ -43,7 +44,7 @@ func getFilesPath(path []string) (filePaths []string, err error) { } if len(filePaths) == 0 { - return nil, fmt.Errorf("no yml file selected") + return nil, fmt.Errorf("no YAML (*.yml or *.yaml) file found or defined") } return uniq(filePaths), nil }