fix: install script to work with non-bash shells (closes #1527)#1550
Closed
aspizu wants to merge 2 commits into
Closed
fix: install script to work with non-bash shells (closes #1527)#1550aspizu wants to merge 2 commits into
aspizu wants to merge 2 commits into
Conversation
aspizu
commented
Feb 8, 2026
- fix: move err definition up before possible invocation
- fix: upgrade shell to bash if not (closes Install script does not work using sh, needs bash #1527)
guybedford
added a commit
that referenced
this pull request
May 13, 2026
…ION (#1578) Two bugs broke `curl https://wasm-bindgen.github.io/wasm-pack/installer/init.sh -sSf | sh`: 1. The arg-parsing block introduced in 15e4f4f used bash arrays (`ORIG_ARGS=("$@")` / `"${ORIG_ARGS[@]}"`), so any non-bash POSIX shell (dash, ash, BusyBox sh) failed with a syntax error. This is issue #1527. 2. `docs/_installer/build-installer.rs` does a literal `$VERSION` -> `vX.Y.Z` text replacement on the script. Since 15e4f4f also added real `$VERSION` shell expansions (`if [ -z "$VERSION" ]`, the `case "$VERSION"`, etc.), every one of those got mangled in the published artifact, e.g. `if [ -z "v0.14.0" ]` and `VERSION="vv0.14.0"`. The runtime --version / VERSION-env override has been silently broken in every published release since. This commit: * switches the build-time placeholder to `@@WASM_PACK_VERSION@@` so it cannot collide with real shell variable references (both in init.sh and index.html). * rewrites init.sh as POSIX sh: no arrays, no `local`, scans args via `for _arg in "$@"` without consuming them so they still pass through to wasm-pack-init. * keeps the precedence: explicit `VERSION=` env > `--version X` arg > build-time baked version > "latest" (resolved via GitHub API). Verified syntax-clean and behaviourally correct under dash, /bin/sh, and bash for piped invocation (`curl ... | sh`), `sh -s -- --version X`, env override, and arg passthrough. Supersedes #1550, closes #1527.
Contributor
|
Fixed via #1578. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.