Fix reading syft json from stdin by redirect (#1299)
I figured out that running `cat syft.json | grype` works but
`grype < syft.json` does not work. This happens, because the
IsPipedInput method only checks if stdin is a pipe which will be false
if stdin is fed by a redirect.
The go idiomatic way to fix this is by just checking if the file
produced by stat has a size > 0.
Implemented this check, that will recognize stdin by redirect, in the
IsPipedInput() method. Renamed the method to IsStdinPipeOrRedirect().
Signed-off-by: Felix Becker <[email protected]>
Co-authored-by: Benjamin Neff <[email protected]>