From 95c9f38035ccc4607c5753edfde6377afed514ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Tue, 8 Jun 2021 14:22:23 +0200 Subject: [PATCH] Update bash uploader to 1.0.3 --- dist/codecov | 9 ++++----- src/codecov | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dist/codecov b/dist/codecov index 9c5514092..d443a8979 100644 --- a/dist/codecov +++ b/dist/codecov @@ -5,7 +5,7 @@ set -e +o pipefail -VERSION="1.0.2" +VERSION="1.0.3" codecov_flags=( ) url="https://codecov.io" @@ -1866,10 +1866,9 @@ else -H 'Accept: text/plain' \ $curlargs \ "$url/upload/v2?$query&attempt=$i" || echo 'HTTP 500') - # HTTP 200 - # http://.... - status=$(echo "$res" | head -1 | cut -d' ' -f2) - if [ "$status" = "" ] || [ "$status" = "200" ]; + # {"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "...", "url": "https://codecov.io/..."\} + uploaded=$(grep -o '\"uploaded\": [a-z]*' <<< "$res" | head -1 | cut -d' ' -f2) + if [ "$uploaded" = "true" ] then say " Reports have been successfully queued for processing at ${b}$(echo "$res" | head -2 | tail -1)${x}" exit 0 diff --git a/src/codecov b/src/codecov index 9c5514092..d443a8979 100644 --- a/src/codecov +++ b/src/codecov @@ -5,7 +5,7 @@ set -e +o pipefail -VERSION="1.0.2" +VERSION="1.0.3" codecov_flags=( ) url="https://codecov.io" @@ -1866,10 +1866,9 @@ else -H 'Accept: text/plain' \ $curlargs \ "$url/upload/v2?$query&attempt=$i" || echo 'HTTP 500') - # HTTP 200 - # http://.... - status=$(echo "$res" | head -1 | cut -d' ' -f2) - if [ "$status" = "" ] || [ "$status" = "200" ]; + # {"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "...", "url": "https://codecov.io/..."\} + uploaded=$(grep -o '\"uploaded\": [a-z]*' <<< "$res" | head -1 | cut -d' ' -f2) + if [ "$uploaded" = "true" ] then say " Reports have been successfully queued for processing at ${b}$(echo "$res" | head -2 | tail -1)${x}" exit 0