Add additional checks for pre-commit hook (#32142)

Signed-off-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
Jon Koops 2024-08-15 00:47:30 +02:00 committed by GitHub
parent ac1faa8c78
commit 3fda9f447d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,4 +7,14 @@ if [ ! -f "$FILE" ]; then
exit 0;
fi
# Exit if dependencies are not installed.
if [ ! -d "node_modules" ]; then
exit 0;
fi
# Exit if pnpm is not installed.
if ! [ -x "$(command -v pnpm)" ]; then
exit 0;
fi
pnpm exec lint-staged