5 REPO_ROOT="${BASH_SOURCE%/*}"
6 DENO_BASE="$REPO_ROOT/vendor/deno"
7 DENO_INSTALLER="$DENO_BASE/install.sh"
8 DENO_INSTALL="$DENO_BASE/local"
9 DENO_EXE="$DENO_INSTALL/bin/deno"
10 DENO_TYPES="$DENO_BASE/types.d.ts"
13 if [ "$ARG" = "--force" -o "$ARG" = "-f" ]; then
18 if [[ ! -e "$DENO_INSTALLER" || $FORCE ]]; then
19 echo "[status] Fetching Deno installer"
20 command curl -fsSL -o "$DENO_INSTALLER" https://deno.land/x/install/install.sh
22 echo "[skip] Fetch Deno installer; use -f to force re-fetch"
25 if [[ ! -e "$DENO_EXE" || $FORCE ]]; then
26 echo "[status] Run Deno installer"
28 command sh "$DENO_INSTALLER"
30 echo "[skip] Run Deno installer; use -f to force re-install"
33 if [[ ! -e "$DENO_TYPES" || $FORCE ]]; then
34 echo "[status] Generate Deno types"
35 "$DENO_EXE" types > "$DENO_TYPES"
37 echo "[skip] Generate Deno types; use -f to force re-generation"
40 echo "[status] Running main"
41 "$DENO_EXE" run --allow-all lib/main.ts "$@"