From 9ccd48b6e6edc9ad09e94d6651c766eaad7335a6 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 27 Jul 2021 08:00:42 +0530 Subject: Allow to run 'npm version' without dependency on git pre-commit hook. [skip ci] --- .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 f1e7b9824..305fe1ebf 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,9 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" -npm run lint && npm run reformat-files && npm run manage-translations && npm run apply-branding +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 prepare-code +fi -- cgit v1.2.3-54-g00ecf