grype/internal
devfbe e1bdbc7d27
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 <git@felixbecker.name>
Co-authored-by: Benjamin Neff <benjamin@coding4coffee.ch>
2023-05-16 19:41:43 +00:00
..
bus Add ETUI (#77) 2020-07-30 19:06:27 -04:00
config feat: add default-image-source-config option (#1215) 2023-04-04 10:28:33 -04:00
file chore: update progress monitor handling (#1149) 2023-03-01 16:47:01 -05:00
format initial project structure 2020-05-26 10:41:23 -04:00
log Update Syft to v0.62.3 (#1026) 2022-12-07 18:30:38 -05:00
logger refactor: move from io/ioutil to io and os packages (#543) 2021-12-15 09:35:04 -05:00
ui Update Syft to v0.62.3 (#1026) 2022-12-07 18:30:38 -05:00
version Grype Release Pipeline Update (#1147) 2023-03-03 21:17:44 +00:00
constants.go Ignore prerelease versions on release + add DB update URL (#76) 2020-07-30 12:37:49 -04:00
input.go Fix reading syft json from stdin by redirect (#1299) 2023-05-16 19:41:43 +00:00
parse.go refactor constraint expression parser to allow for quoted versions 2021-02-16 09:15:17 -05:00
string_helpers.go Support for private certificate authorities during DB curation (#494) 2021-11-22 16:59:38 +00:00
string_helpers_test.go Support for private certificate authorities during DB curation (#494) 2021-11-22 16:59:38 +00:00
stringset.go Port grype-db to grype (#587) 2022-01-12 10:03:22 -05:00