#!/usr/bin/env bash
set -euo pipefail

command -v dotnet >/dev/null || { echo "dotnet SDK 10 is required" >&2; exit 1; }
command -v node >/dev/null || { echo "Node.js is required" >&2; exit 1; }
command -v corepack >/dev/null || { echo "corepack is required" >&2; exit 1; }

dotnet --version
node --version
corepack --version

if [[ ! -f frontend/pnpm-lock.yaml ]]; then
  echo "frontend/pnpm-lock.yaml is missing. Run 'cd frontend && corepack enable && pnpm install' and commit it." >&2
  exit 2
fi
