diff --git a/js/.husky/pre-commit b/js/.husky/pre-commit index 23aef7712bb..68ab20e02e9 100755 --- a/js/.husky/pre-commit +++ b/js/.husky/pre-commit @@ -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