#!/usr/bin/env bash
# Pre-commit-style check: compile LESS + run parser smoke.
# Fails non-zero if anything is broken. Run from package root.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"

if [ ! -d "node_modules/less" ]; then
  echo "less not installed — run: npm install" >&2
  exit 2
fi

node tools/lint-less.cjs
echo
echo "== Parser smoke =="
node spec/smoke.cjs
