From 48570111766989f3135be6c24491875720ef9a1b Mon Sep 17 00:00:00 2001 From: Priyanshu Dangare Date: Mon, 9 Feb 2026 02:58:49 +0530 Subject: [PATCH 1/2] fix: move err definition up before possible invocation --- docs/_installer/init.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/_installer/init.sh b/docs/_installer/init.sh index 28ced2fb..acb5733c 100644 --- a/docs/_installer/init.sh +++ b/docs/_installer/init.sh @@ -39,6 +39,11 @@ if [ -z "${VERSION:-}" ]; then fi fi +err() { + say "$1" >&2 + exit 1 +} + # Resolve "latest" to actual version number if [ "$VERSION" = "latest" ]; then VERSION=$(curl -s https://api.github.com/repos/drager/wasm-pack/releases/latest | grep '"tag_name"' | sed -E 's/.*"v?([^"]+)".*/\1/') @@ -187,11 +192,6 @@ say() { echo "wasm-pack-init: $1" } -err() { - say "$1" >&2 - exit 1 -} - need_cmd() { if ! check_cmd "$1" then err "need '$1' (command not found)" From 7ff5a2aaf6cf45174716ff3ceb82e5e4732a92b9 Mon Sep 17 00:00:00 2001 From: Priyanshu Dangare Date: Mon, 9 Feb 2026 03:05:05 +0530 Subject: [PATCH 2/2] fix: upgrade shell to bash if not (closes #1527) --- docs/_installer/init.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_installer/init.sh b/docs/_installer/init.sh index acb5733c..c3f782c2 100644 --- a/docs/_installer/init.sh +++ b/docs/_installer/init.sh @@ -12,6 +12,10 @@ # This is just a little script that can be downloaded from the internet to # install wasm-pack. It just does platform detection, downloads the installer # and runs it. +if [ -z "$BASH_VERSION" ]; then + curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash + exit "$?" +fi set -u