#!/bin/sh
# Validate package.json before every commit
node -e "JSON.parse(require('fs').readFileSync('package.json','utf8'))" || {
  echo "ERROR: package.json is invalid JSON. Fix it before committing."
  exit 1
}
