[2.x] fix: Add --fail to curl in launcher to prevent corrupt jars (#9003)

When the download URL returns an HTTP error (e.g. 404), curl without
--fail exits 0 and saves the error page HTML as the jar file. This
leaves a corrupt jar that causes confusing errors on subsequent runs.

With --fail, curl returns a non-zero exit code on HTTP errors and
does not write the response body to the output file.

Fixes #6654

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BrianHotopp 2026-04-10 01:31:52 -04:00 committed by GitHub
parent 7218b2a1ac
commit 00632754ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

2
sbt
View File

@ -142,7 +142,7 @@ download_url () {
local jar="$2"
mkdir -p $(dirname "$jar") && {
if command -v curl > /dev/null; then
curl --silent -L "$url" --output "$jar"
curl --fail --silent -L "$url" --output "$jar"
elif command -v wget > /dev/null; then
wget --quiet -O "$jar" "$url"
else