From 7b64c47733960a0c6c198dffbc20e78c8269fb0b Mon Sep 17 00:00:00 2001 From: John Oleksowicz Date: Fri, 12 Jan 2024 13:00:58 -0600 Subject: [PATCH] Don't run any git hooks unless env variable is set MAILPOET-4237 --- .husky/post-checkout | 4 +++- .husky/post-merge | 3 +++ .husky/post-rewrite | 3 +++ .husky/pre-commit | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.husky/post-checkout b/.husky/post-checkout index 1a255d835d..8d4a054e93 100755 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -1,5 +1,7 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -. "$(dirname "$0")/common.sh" +. "$(dirname "$0")/../mailpoet/.env" +[ "$MP_GIT_HOOKS_ENABLE" != "true" ] && exit 0 +. "$(dirname "$0")/common.sh" installIfUpdates diff --git a/.husky/post-merge b/.husky/post-merge index 1a255d835d..0b82080ef8 100755 --- a/.husky/post-merge +++ b/.husky/post-merge @@ -1,5 +1,8 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/../mailpoet/.env" +[ "$MP_GIT_HOOKS_ENABLE" != "true" ] && exit 0 + . "$(dirname "$0")/common.sh" installIfUpdates diff --git a/.husky/post-rewrite b/.husky/post-rewrite index 1a255d835d..0b82080ef8 100755 --- a/.husky/post-rewrite +++ b/.husky/post-rewrite @@ -1,5 +1,8 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/../mailpoet/.env" +[ "$MP_GIT_HOOKS_ENABLE" != "true" ] && exit 0 + . "$(dirname "$0")/common.sh" installIfUpdates diff --git a/.husky/pre-commit b/.husky/pre-commit index ac4279c93a..293ab1cba4 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,7 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/../mailpoet/.env" +[ "$MP_GIT_HOOKS_ENABLE" != "true" ] && exit 0 npx lint-staged -c mailpoet/package.json --cwd mailpoet npx lint-staged -c package.json