From 904fafb5d1be774f24fcb5c882e57ff4915457a7 Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Tue, 29 Jun 2021 18:42:10 -0400 Subject: [PATCH] entrypoint.sh: Ensure exit code is from flawfinder Ensure that the returned exit code is from flawfinder, not another tool (like "tee"). Signed-off-by: David A. Wheeler --- entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 30746e4..f887f2e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,10 @@ # $1 whitespace-separated arguments. Some filenames may need to be escaped. # $2 output filename -flawfinder $1 | tee "$2" +output="${2:-flawfinder-output.txt}" + +flawfinder $1 > "$output" +result="$?" + +cat "$output" +exit "$result"