| 1 | #!/usr/bin/env bash |
| 2 | # One-time container setup, baked into prebuilds. Content-dependent work |
| 3 | # (dependency install, Chromium) lives in update-content.sh. |
| 4 | set -euo pipefail |
| 5 | |
| 6 | # The Vite+ CLI is the repo task runner (vp i, vp run dev, vp test run). |
| 7 | # Download to a file first: a curl failure inside $( ) would yield an empty |
| 8 | # script and a false success. VP_NODE_MANAGER=no skips the installer's node |
| 9 | # shims; Node comes from the devcontainer feature. The VP_*_DIR group (set |
| 10 | # together, absolute) pins the install location instead of the installer's |
| 11 | # XDG platform defaults, which moved the binary from ~/.vite-plus/bin to |
| 12 | # ~/.local/share/vite-plus/bin between releases and would break the check |
| 13 | # below either way. |
| 14 | export VP_BIN_DIR="$HOME/.local/share/vite-plus/bin" |
| 15 | export VP_DATA_DIR="$HOME/.local/share/vite-plus" |
| 16 | export VP_CACHE_DIR="$HOME/.cache/vite-plus" |
| 17 | installer=$(mktemp) |
| 18 | curl -fsSL https://vite.plus -o "$installer" |
| 19 | VP_NODE_MANAGER=no bash "$installer" |
| 20 | rm -f "$installer" |
| 21 | |
| 22 | # Non-login lifecycle shells never source the profile the installer edits, |
| 23 | # so expose vp on the default PATH. test -x keeps a bad install loud. |
| 24 | test -x "$VP_BIN_DIR/vp" |
| 25 | sudo ln -sf "$VP_BIN_DIR/vp" /usr/local/bin/vp |
| 26 | |
| 27 | # First-run terminal notice, rendered by the devcontainers base image. |
| 28 | sudo mkdir -p /usr/local/etc/vscode-dev-containers |
| 29 | sudo tee /usr/local/etc/vscode-dev-containers/first-run-notice.txt >/dev/null <<'EOF' |
| 30 | T3 Code devcontainer |
| 31 | |
| 32 | vp run dev start server + web, then open the pairing URL it |
| 33 | prints (the bare forwarded port will not authenticate) |
| 34 | cp .env.example .env optional: enable T3 Connect cloud features |
| 35 | (public identifiers, not secrets) |
| 36 | |
| 37 | Details: docs/internals/devcontainer.md |
| 38 | EOF |