feat: TypeScript installation wizard with @clack/prompts TUI (#1)
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #1.
This commit is contained in:
25
bin/mosaic-wizard
Executable file
25
bin/mosaic-wizard
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# mosaic-wizard — Thin shell wrapper for the bundled TypeScript wizard
|
||||
MOSAIC_HOME="${MOSAIC_HOME:-$HOME/.config/mosaic}"
|
||||
|
||||
# Look for the bundle in the installed location first, then the source repo
|
||||
WIZARD_BIN="$MOSAIC_HOME/dist/mosaic-wizard.mjs"
|
||||
if [[ ! -f "$WIZARD_BIN" ]]; then
|
||||
WIZARD_BIN="$(cd "$(dirname "$0")/.." && pwd)/dist/mosaic-wizard.mjs"
|
||||
fi
|
||||
|
||||
if [[ ! -f "$WIZARD_BIN" ]]; then
|
||||
echo "[mosaic-wizard] ERROR: Wizard bundle not found." >&2
|
||||
echo "[mosaic-wizard] Run 'pnpm build' in the mosaic-bootstrap repo, or re-install Mosaic." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "[mosaic-wizard] ERROR: Node.js is required but not found." >&2
|
||||
echo "[mosaic-wizard] Install Node.js 18+ from https://nodejs.org" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec node "$WIZARD_BIN" "$@"
|
||||
Reference in New Issue
Block a user