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 <dwheeler@dwheeler.com>
This commit is contained in:
David A. Wheeler 2021-06-29 18:42:10 -04:00
parent 982e703f2a
commit 904fafb5d1
1 changed files with 7 additions and 1 deletions

View File

@ -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"