tree-sitter/script/fetch-emscripten
2024-07-28 10:12:55 +03:00

26 lines
536 B
Bash
Executable file

#!/usr/bin/env bash
set -e
EMSDK_DIR=target/emsdk
EMSCRIPTEN_VERSION=$(< cli/loader/emscripten-version)
{
if [[ ! -f $EMSDK_DIR/emsdk ]]; then
printf 'Downloading emscripten SDK...\n'
git clone https://github.com/emscripten-core/emsdk.git $EMSDK_DIR
fi
cd $EMSDK_DIR
printf 'Updating emscripten SDK...\n'
git reset --hard
git pull
./emsdk list
printf 'Installing emscripten...\n'
./emsdk install "$EMSCRIPTEN_VERSION"
printf 'Activating emscripten...\n'
./emsdk activate "$EMSCRIPTEN_VERSION"
} >&2