keycloak-scim/js/.husky/pre-commit
Jon Koops 3fda9f447d
Add additional checks for pre-commit hook (#32142)
Signed-off-by: Jon Koops <jonkoops@gmail.com>
2024-08-15 00:47:30 +02:00

20 lines
362 B
Text
Executable file

# Get the path the the Husky script.
DIRNAME="$(dirname "$0")"
FILE="$DIRNAME/_/husky.sh"
# Exit if Husky is not installed.
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