Commit 003c7c28 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(bash mode): unmask errors in shell pipelines with 'set -o pipefail'

parent bf621646
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ stages:

.mobsf-scripts: &mobsf-scripts |
  # BEGSCRIPT
  set -e
  set -eo pipefail

  function log_info() {
      echo -e "[\\e[1;94mINFO\\e[0m] $*"
@@ -209,7 +209,7 @@ stages:
      sleep 1
      counter=$((counter + 1))
    done
    set -e
    set -eo pipefail

    return $result
  }
@@ -378,7 +378,7 @@ stages:
    set +e
    http_code=$(curl --max-time 10 -s -X POST --url "${MOBSF_SERVER_URL}/api/v1/scan" --data "scan_type=${scan_type}&file_name=${file_name}&hash=${hash}" -H "Authorization: ${MOBSF_API_KEY}" -o ./out -w '%{http_code}')
    exit_code=$?
    set -e
    set -eo pipefail
    # exit code 28 (timeout) is allowed as POST /api/v1/scan is synchronous and waits for the scan to terminate
    if [ ${exit_code} -ne 28 ]; then
      if [ "${http_code}" -ne 200 ]; then