From 551f4116f7e250b3645e6fc4872258fbb68f8da2 Mon Sep 17 00:00:00 2001 From: Matt Hall Date: Wed, 10 Jan 2024 09:43:42 +0100 Subject: [PATCH] Allow curl to fail when file 404s I guess we run with set -e and curl returns 1 when the file is 404. So this version always returns true from the curl, and we don't exit. Fixes #457. --- ci/testkomodo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/testkomodo.sh b/ci/testkomodo.sh index 99527807..8afa6057 100755 --- a/ci/testkomodo.sh +++ b/ci/testkomodo.sh @@ -19,13 +19,13 @@ start_tests () { start_integration_test () { - chromium_version=$(chromium-browser --version | grep -zoP '\d+\.\d+\.\d+\.\d+') - chromium_minor_version=$(echo $chromium_version | grep -zoP '^\d+\.\d+\.\d+') + chromium_version=$(chromium-browser --version | grep -oP '\d+\.\d+\.\d+\.\d+') + chromium_minor_version=$(echo $chromium_version | grep -oP '^\d+\.\d+\.\d+') # Sometimes the chromium-browser has no matching chromedriver. # Check for HTTP 404 error download_url="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$chromium_version/linux64/chromedriver-linux64.zip" - download_status=$(curl --head "$download_url" | grep 'HTTP/2 200') + download_status=$((curl --head "$download_url" || true) | grep -oP 'HTTP/.+? 200 OK') driver_version=$chromium_version if [[ -z "$download_status" ]]; then