Skip to content

Commit 5118b1f

Browse files
fix: use string instead of array for optional curl auth header
1 parent 8ae9b36 commit 5118b1f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/publish.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ trap 'rm -f "$body_file"' EXIT
8787
# curl -sS (no --fail) returns 0 for any HTTP response, non-zero only on
8888
# network/protocol errors — so we can cleanly separate "server answered" from
8989
# "could not reach server".
90-
curl_auth_args=()
90+
auth_header=""
9191
if [[ -n "${NODE_AUTH_TOKEN:-}" ]]; then
92-
curl_auth_args=(-H "Authorization: Bearer ${NODE_AUTH_TOKEN}")
92+
auth_header="Authorization: Bearer ${NODE_AUTH_TOKEN}"
9393
fi
9494
if ! http_code=$(curl -sS -m 30 -o "$body_file" -w '%{http_code}' \
95-
"${curl_auth_args[@]}" "$packument_url"); then
95+
${auth_header:+-H "$auth_header"} "$packument_url"); then
9696
echo "ERROR: request to ${packument_url} failed (network/timeout); refusing to publish on an ambiguous result." >&2
9797
exit 1
9898
fi

0 commit comments

Comments
 (0)