From 09b128946cd52258c7b38c893ac57a95da41825f Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Sun, 27 Jun 2021 16:43:54 -0400 Subject: [PATCH] entrypoint.sh: Modify to use "$@" Modify entrypoint.sh, used by the Dockerfile. The previous version of entrypoint.sh only used the first parameter. What's worse, it would double-expand globs (referring to "*.c", if a file was named *.c, that would get expanded again). Usually variable references in shell are quoted. In addition, the original version *ALWAYS* echoed a success, even if the command did NOT succeed for some reason. Instead of printing the spurious message, just show the output and let the exit value get communicated back to the caller. This is especially important for CI/CD, since we want the CI/CD system to get the exit value (e.g., so it can report failure if there was a failure). Signed-off-by: David A. Wheeler --- entrypoint.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index b89e0ad..4988bfe 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,4 @@ # $1 arguments. BEWARE: Some filenames may need to be escaped. # $2 output filename -flawfinder $1 > "$2" - -echo "Executed with success." +flawfinder "$@" > "$2"