]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
travis: Don't pipe negative lgtm.com result into jq
authorTobias Brunner <tobias@strongswan.org>
Thu, 11 Jun 2020 08:29:11 +0000 (10:29 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 11 Jun 2020 11:29:47 +0000 (13:29 +0200)
The data might not be valid JSON.

scripts/test.sh

index 03170c86c0d1b315590a5ab0f7868ab93e97bc2f..57776f3cffb2784219a7c83a8771c06aa48ae1a8 100755 (executable)
@@ -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)