diff --git a/src/usr/local/bin/verapdf_validation_wrapper.sh b/src/usr/local/bin/verapdf_validation_wrapper.sh index b1518fa606f8688a6cfb6a349b9df3fc19c6ffd0..44e2212295b8a98debd05bfefd477f3ff8d79c4c 100755 --- a/src/usr/local/bin/verapdf_validation_wrapper.sh +++ b/src/usr/local/bin/verapdf_validation_wrapper.sh @@ -17,13 +17,13 @@ if ! [[ -f "${FILE}" ]]; then exit 1; fi -IS_VALID=1; +RESULT=1; TOOL_OUTPUT=""; for FLAVOUR in "2u" "2a" "2b" "1a" "1b" "ua1"; do TMP=$(/usr/local/bin/verapdf --nonpdfext -f "${FLAVOUR}" -v "${FILE}") - IS_VALID=$?; + RESULT=$?; TOOL_OUTPUT+="\n${TMP}" - if [[ "${IS_VALID}" -eq 0 ]]; then + if [[ "${RESULT}" -eq 0 ]]; then break fi done @@ -33,4 +33,4 @@ echo -e "${TOOL_OUTPUT}" # exit code # 0 -> valid pdf/a file and allowed pdf/a flavour # != 0 -> invalid pdf/a file or disallowed pdf/a flavour -exit "${IS_VALID}" +exit "${RESULT}"