Files
emb_cli/bootstrap.sh
T
Joel Winarske 1af62109e4 feat(bootstrap): add --shellenv for one-line PATH setup
--shellenv emits an eval-able export of the Dart SDK bin and the emb shim
dir, so eval "$(./bootstrap.sh --shellenv)" fetches Dart, activates emb,
and puts both on PATH in one line. The default clean-stdout bin-dir output
is unchanged.

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
2026-06-18 08:08:25 -07:00

14 lines
620 B
Bash
Executable File

#!/usr/bin/env sh
# Fetch a cached Dart SDK and install `emb` from this checkout (Linux/macOS).
# All flags pass through, e.g. `./bootstrap.sh --version 3.10.1`.
#
# Bare run prints the SDK bin dir on stdout — capture it to put Dart on PATH:
# DART_BIN=$(./bootstrap.sh) && export PATH="$DART_BIN:$PATH"
# Or emit an eval-able export of both Dart + the emb shim dir in one step:
# eval "$(./bootstrap.sh --shellenv)"
#
# Windows: run `python tool\bootstrap_dart.py --activate .` instead.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
exec python3 "$root/tool/bootstrap_dart.py" --activate "$root" "$@"