Only run the pre-commit hooks when Husky is installed (#21587)
This commit is contained in:
parent
57423bca2b
commit
70f293bca1
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue