diff --git a/docs/_installer/init.sh b/docs/_installer/init.sh index 28ced2fb..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 @@ -39,6 +43,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 +196,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)"