#!/usr/bin/env bash

INSTALL_DIR="$1"
FULL_DIR="$INSTALL_DIR/emsdk"

mkdir -p "$FULL_DIR"
git clone https://github.com/emscripten-core/emsdk.git "$FULL_DIR"
cd "$FULL_DIR"
"$FULL_DIR/emsdk" install 3.1.62
"$FULL_DIR/emsdk" activate 3.1.62
source "$FULL_DIR/emsdk_env.sh"