Fixed bug - ignore path expressions that match a directory

This commit is contained in:
Mike Farah
2022-02-07 08:04:26 +11:00
parent 926a68181b
commit 5ac3c57510
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -98,6 +98,6 @@ func configureEncoder(format yqlib.PrinterOutputFormat) yqlib.Encoder {
// without this - yq detects there is stdin (thanks githubactions),
// then tries to parse the filename as an expression
func maybeFile(str string) bool {
_, err := os.Stat(str) // #nosec
return err == nil
stat, err := os.Stat(str) // #nosec
return err == nil && !stat.IsDir()
}