Only run the pre-commit hooks when Husky is installed (#21587)

This commit is contained in:
Jon Koops 2023-07-11 12:41:41 +02:00 committed by GitHub
parent 57423bca2b
commit 70f293bca1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,14 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Get the path the the Husky script.
FILE="$(dirname "$0")/_/husky.sh"
# Exit if Husky is not installed.
if [ ! -f "$FILE" ]; then
exit 0;
fi
# Run the Husky script, and pre-commit hooks.
. $FILE
cd js
npx lint-staged