entrypoint.sh: Make minor improvements (#54)
* entrypoint.sh: Make minor improvements Modify entrypoint.sh, used by the Dockerfile. 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). This version also displays the results to standard out, so it's easier to immediately see the output from a CI/CD run. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
This commit is contained in:
parent
18b559b69d
commit
b7e8ebe3df
|
@ -1,7 +1,11 @@
|
|||
#!/bin/sh -l
|
||||
# $1 arguments. BEWARE: Some filenames may need to be escaped.
|
||||
# $1 whitespace-separated arguments. Some filenames may need to be escaped.
|
||||
# $2 output filename
|
||||
|
||||
flawfinder $1 > "$2"
|
||||
output="${2:-flawfinder-output.txt}"
|
||||
|
||||
echo "Executed with success."
|
||||
flawfinder $1 > "$output"
|
||||
result="$?"
|
||||
|
||||
cat "$output"
|
||||
exit "$result"
|
||||
|
|
Loading…
Reference in New Issue