Skip to content

Commit

Permalink
fix (Laerdal.GenerateSignAndUploadSbom.sh): fix a bug which was causi…
Browse files Browse the repository at this point in the history
…ng the script to not terminate in case of an upload error
  • Loading branch information
ksidirop-laerdal committed Nov 19, 2024
1 parent 6af212f commit c48b8c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Laerdal.Scripts/Laerdal.GenerateSignAndUploadSbom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,11 @@ function generate_sign_and_upload_sbom() {
\
-w "%{http_code}"
)
declare exitCode=$?
set +x
# declare exitCode=$? # no point to get the exit code because we use a subshell to capture the http response code

echo "** Curl sbom-uploading HTTP Response Code: ${http_response_code}"

if [ ${exitCode} != 0 ]; then
if [[ -z ${http_response_code} ]] || [[ ${http_response_code} -gt 299 ]]; then
echo "SBOM Uploading failed!"
exit 40
fi
Expand All @@ -402,3 +401,4 @@ function main() {
}

main "$@"
# set +x

0 comments on commit c48b8c5

Please sign in to comment.