travis: Don't pipe negative lgtm.com result into jq

The data might not be valid JSON.
This commit is contained in:
Tobias Brunner
2020-06-11 13:29:47 +02:00
parent 364d8b2628
commit 4b225bf866
+2 -2
View File
@@ -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)