From 05f4ab929ebe4a7db85358e27ba9c9639c1525e4 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 30 Oct 2021 07:43:12 +0530 Subject: Do not error out if husky has not been installed. Ignore .husky folder from Docker context --- .husky/pre-commit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.husky') diff --git a/.husky/pre-commit b/.husky/pre-commit index 20d0d06..1a92cb3 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,9 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" -npm run lint +FILE_NAME="$(dirname "$0")/_/husky.sh" + +# Conditionally invoke so as to avoid running npm commands if this is a clean checkout (ie before installing npm modules) +if [ -f $FILE_NAME ]; then + . $FILE_NAME + npm run lint +fi -- cgit v1.2.3-54-g00ecf