Skip to content

fix: Fail build if curl of cached file fails#339

Merged
darcywong00 merged 2 commits intokeymanapp:masterfrom
darcywong00:fix/curl-fail
Feb 5, 2026
Merged

fix: Fail build if curl of cached file fails#339
darcywong00 merged 2 commits intokeymanapp:masterfrom
darcywong00:fix/curl-fail

Conversation

@darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Feb 5, 2026

Follows #337 on caching files from downloads.keyman if external source is not available

  • Adds -f (--fail) flag to curl command to fail the build
  • Style error message with builder_die

Test-bot: skip

@darcywong00 darcywong00 added this to the A19S22 milestone Feb 5, 2026
@darcywong00 darcywong00 requested a review from mcdurdin February 5, 2026 06:35
local version=`curl "$query" | $JQ -r '.[].version'`
local model_info_filename="https://downloads.keyman.com/models/${model_id}/${version}/${model_id}.model_info"
curl -s -L "$model_info_filename" --output "$model_id.model_info" --create-dirs || die "Unable to download $model_info_filename"
curl -s -L -f "$model_info_filename" --output "$filename" --create-dirs || builder_die "Unable to download $model_info_filename"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$filename = $model_id.model_info

But keeping consistent with the other files

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only question is, wouldn't it have failed soon after on the checksum anyway?

@darcywong00
Copy link
Contributor Author

Only question is, wouldn't it have failed soon after on the checksum anyway?

Yeah, that would have flagged it too

Co-authored-by: Marc Durdin <marc@durdin.net>
@darcywong00 darcywong00 merged commit c696d15 into keymanapp:master Feb 5, 2026
2 checks passed
@darcywong00 darcywong00 deleted the fix/curl-fail branch February 6, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants