badguardhome/.githooks/pre-commit

19 lines
354 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e;
2020-09-09 11:03:27 +00:00
found=0
git diff --cached --name-only | grep -q '.js$' && found=1
if [ $found == 1 ]; then
2020-09-09 11:03:27 +00:00
npm --prefix client run lint || exit 1
npm run test --prefix client || exit 1
fi
found=0
git diff --cached --name-only | grep -q '.go$' && found=1
if [ $found == 1 ]; then
make lint-go || exit 1
go test ./... || exit 1
fi
exit 0;