From: Tobias Brunner Date: Thu, 11 Jun 2020 08:29:11 +0000 (+0200) Subject: travis: Don't pipe negative lgtm.com result into jq X-Git-Tag: 5.9.0dr2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b225bf8661250a5abf5ad2e7ec3bef96ec0a40d;p=thirdparty%2Fstrongswan.git travis: Don't pipe negative lgtm.com result into jq The data might not be valid JSON. --- diff --git a/scripts/test.sh b/scripts/test.sh index 03170c86c0..57776f3cff 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -330,8 +330,8 @@ lgtm) -H 'Accept: application/json' \ -H "Authorization: Bearer ${LGTM_TOKEN}" > lgtm.res || exit $? lgtm_check_url=$(jq -r '."task-result-url"' lgtm.res) - if [ "$lgtm_check_url" = "null" ]; then - cat lgtm.res | jq + if [ -z "$lgtm_check_url" -o "$lgtm_check_url" = "null" ]; then + cat lgtm.res exit 1 fi lgtm_url=$(jq -r '."task-result"."results-url"' lgtm.res)