diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit index 7a3d680a4..2ccf8df89 100755 --- a/scripts/git-hooks/pre-commit +++ b/scripts/git-hooks/pre-commit @@ -40,10 +40,13 @@ if [ $? != 0 ]; then EXIT=1 fi -echo "Checking UI ESLint, TypeScript, and Prettier compliance..." -yarn --cwd "$PWD/netbox/project-static" validate -if [ $? != 0 ]; then - EXIT=1 +git diff --cached --name-only | if grep --quiet 'netbox/project-static/' +then + echo "Checking UI ESLint, TypeScript, and Prettier compliance..." + yarn --cwd "$PWD/netbox/project-static" validate + if [ $? != 0 ]; then + EXIT=1 + fi fi if [ $EXIT != 0 ]; then