1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

10310 pre commit yarn (#10315)

* #10310 run yarn pre-commit only if static files changed
This commit is contained in:
Arthur Hanson
2022-09-12 06:16:17 -07:00
committed by GitHub
parent 3aac62caa7
commit 721cd578bb

View File

@ -40,11 +40,14 @@ if [ $? != 0 ]; then
EXIT=1 EXIT=1
fi fi
git diff --cached --name-only | if grep --quiet 'netbox/project-static/'
then
echo "Checking UI ESLint, TypeScript, and Prettier compliance..." echo "Checking UI ESLint, TypeScript, and Prettier compliance..."
yarn --cwd "$PWD/netbox/project-static" validate yarn --cwd "$PWD/netbox/project-static" validate
if [ $? != 0 ]; then if [ $? != 0 ]; then
EXIT=1 EXIT=1
fi fi
fi
if [ $EXIT != 0 ]; then if [ $EXIT != 0 ]; then
printf "${RED}COMMIT FAILED${NOCOLOR}\n" printf "${RED}COMMIT FAILED${NOCOLOR}\n"