fix(install): require git alongside Node (pi install git: needs it)

Found in a clean cps sandbox run: a machine without git passes the Node check
but fails later inside 'pi install git:...' with an unclear error. Now checked
up front with an actionable message. CHANGELOG updated.

Decision on optionalDependencies (@modelcontextprotocol/sdk): KEEP. The heavy
install observed in the sandbox (~317 packages) is dominated by npm>=7
auto-installing the Pi peerDependencies stack, not the MCP SDK; removing the
SDK saves little and would make MCP enablement fragile across pi updates.
This commit is contained in:
dev
2026-07-16 15:12:12 +03:00
parent 38f4ecf81f
commit be2d445a09
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -52,6 +52,13 @@ if [ "$NODE_MAJOR" -lt "$MIN_NODE_MAJOR" ]; then
fi
info "Node.js $(node -v) — ок."
# --- 1b. git (required by `pi install git:...`) ------------------------------
if ! command -v git >/dev/null 2>&1; then
err "git не найден. Установи git (macOS: xcode-select --install; Ubuntu: apt install git) и запусти скрипт снова."
exit 1
fi
info "git $(git --version | awk '{print $3}') — ок."
# --- 2. Pi ------------------------------------------------------------------
if command -v pi >/dev/null 2>&1; then
info "Pi уже установлен ($(pi --version 2>/dev/null || echo 'версия неизвестна'))."