Skip to content

fix(misc): make the download script work with POSIX sh - #835

Open
spa77k wants to merge 1 commit into
PaperMC:mainfrom
spa77k:fix/downloads-script-posix
Open

spa77k wants to merge 1 commit into
PaperMC:mainfrom
spa77k:fix/downloads-script-posix

Conversation

@spa77k

@spa77k spa77k commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Closes #833

The "Downloading the latest stable build" example uses #!/usr/bin/env sh, but it fails when sh is dash (the default on Debian/Ubuntu):

  • dash's echo interprets backslash escapes, so the \n in commit messages inside the builds response turns into real newlines and jq fails with Invalid string: control characters ... must be escaped. The script now passes the response to jq with printf '%s\n' "$VAR" instead.
  • [ "$PAPERMC_URL" == "null" ] is a bashism. dash prints [: unexpected operator, so the check is skipped and the script reported "Download completed" with an empty URL. It now uses =.

Verification:

  • Ran the old script with dash and reproduced both problems.
  • Ran the new script with dash and bash for 26.3 (has stable builds), 26.3-rc-3 (no stable build, falls back to 26.3), and an unknown version (prints the API error). The download step was replaced with an echo of the URL.
  • pnpm build and prettier --check on the changed file passed.

@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
papermc-docs ✅ Ready (View Log) Visit Preview bd0fadf

This branch was successfully deployed

1 active deployment
Preview — bd0fadf3 Deployed Dec 6, 2026 by github-actions[bot]
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.

Download Script Example Fails

1 participant