Skip to content

Commit

Permalink
feat: allows venom CLI tu support both .yml and .yaml extensions duri…
Browse files Browse the repository at this point in the history
…ng venom run default command (#495)

Signed-off-by: scraly <scraly@gmail.com>
  • Loading branch information
scraly authored Jan 25, 2022
1 parent b3ab202 commit 78358f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions process_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down

0 comments on commit 78358f5

Please sign in to comment.