pre-commit 448 B

123456789101112
  1. set -e
  2. npx lint-staged
  3. # Marketplace path-source plugins are git-cloned without `npm install`, so the
  4. # `build/` artifacts must be committed for the plugin to work after install.
  5. # Keep them fresh: if any staged file is under src/, rebuild and stage build/.
  6. if git diff --cached --name-only --diff-filter=ACMR | grep -q '^src/'; then
  7. echo "src/ changed — rebuilding build/ for plugin distribution"
  8. npm run build --silent
  9. git add build
  10. fi