From bb538146ac49bc06dc970d7f1fbae73961efee65 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com> Date: Fri, 9 Jan 2026 11:22:50 +0200 Subject: [PATCH] chore: allow older curl versions as well (#1) --- scripts/setup/setup-nomos-circuits.sh | 13 ++++++++++++- .../assets/stack/scripts/setup-nomos-circuits.sh | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/setup/setup-nomos-circuits.sh b/scripts/setup/setup-nomos-circuits.sh index 1098fe9..266cf77 100755 --- a/scripts/setup/setup-nomos-circuits.sh +++ b/scripts/setup/setup-nomos-circuits.sh @@ -119,7 +119,18 @@ setup_nomos_circuits::download_release() { setup_nomos_circuits::print_info "Downloading nomos-circuits ${VERSION} for ${platform}..." setup_nomos_circuits::print_info "URL: ${url}" - local -a curl_args=(curl -fL --retry "${CURL_RETRY_COUNT}" --retry-delay "${CURL_RETRY_DELAY_SECONDS}" --retry-all-errors) + local -a curl_args=( + curl + -fL + --retry "${CURL_RETRY_COUNT}" + --retry-delay "${CURL_RETRY_DELAY_SECONDS}" + ) + # `curl` is not guaranteed to support `--retry-all-errors`, so check before using it + # `curl --help` may be abbreviated on some platforms + if (curl --help all 2>/dev/null || curl --help 2>/dev/null) | grep -q -- '--retry-all-errors'; then + curl_args+=(--retry-all-errors) + fi + if [ -n "${GITHUB_TOKEN:-}" ]; then curl_args+=(--header "authorization: Bearer ${GITHUB_TOKEN}") fi diff --git a/testing-framework/assets/stack/scripts/setup-nomos-circuits.sh b/testing-framework/assets/stack/scripts/setup-nomos-circuits.sh index 247c072..2f9318b 100644 --- a/testing-framework/assets/stack/scripts/setup-nomos-circuits.sh +++ b/testing-framework/assets/stack/scripts/setup-nomos-circuits.sh @@ -50,7 +50,18 @@ download_release() { temp_dir=$(mktemp -d) echo "Downloading nomos-circuits ${VERSION} for ${platform}..." - local -a curl_args=(curl -fL --retry "${CURL_RETRY_COUNT}" --retry-delay "${CURL_RETRY_DELAY_SECONDS}" --retry-all-errors) + local -a curl_args=( + curl + -fL + --retry "${CURL_RETRY_COUNT}" + --retry-delay "${CURL_RETRY_DELAY_SECONDS}" + ) + # `curl` is not guaranteed to support `--retry-all-errors`, so check before using it + # `curl --help` may be abbreviated on some platforms + if (curl --help all 2>/dev/null || curl --help 2>/dev/null) | grep -q -- '--retry-all-errors'; then + curl_args+=(--retry-all-errors) + fi + if [ -n "${GITHUB_TOKEN:-}" ]; then curl_args+=(-H "Authorization: Bearer ${GITHUB_TOKEN}") fi