Fixing github build

This commit is contained in:
Mike Farah
2022-01-27 15:54:26 +11:00
parent 01b4917f26
commit dedd1ca892
4 changed files with 12 additions and 4 deletions
+10
View File
@@ -91,3 +91,13 @@ func configureEncoder(format yqlib.PrinterOutputFormat) yqlib.Encoder {
}
panic("invalid encoder")
}
// this is a hack to enable backwards compatibility with githubactions (which pipe /dev/null into everything)
// and being able to call yq with the filename as a single parameter
//
// 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
}