#!/bin/sh
# Pre-push hook: run TypeScript check and build before every push.

while read local_ref local_sha remote_ref remote_sha; do
  : # no-op; pushes to main are allowed now

done

echo "Running npm run check..."
npm run check || {
  echo "TypeScript check failed. Push aborted."
  exit 1
}

echo "Running npm run build..."
npm run build || {
  echo "Build failed. Push aborted."
  exit 1
}

echo "All checks passed. Pushing..."
