From 3fd5e2e859a557e03fbb0f99e9ab483c065fd5ab Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:52:47 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20husky=20upgrade=20to=20v8=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> --- .husky/commit-msg | 19 ++++++++++++++++++- .husky/pre-commit | 2 +- .husky/pre-push | 4 ---- 3 files changed, 19 insertions(+), 6 deletions(-) delete mode 100755 .husky/pre-push diff --git a/.husky/commit-msg b/.husky/commit-msg index 314e8214..ff455dc5 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,21 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx --no-install commitlint --edit $1 \ No newline at end of file +NAME=$(git config user.name) +EMAIL=$(git config user.email) + +if [ -z "$NAME" ]; then + echo "empty git config user.name" + exit 1 +fi + +if [ -z "$EMAIL" ]; then + echo "empty git config user.email" + exit 1 +fi + +git interpret-trailers --if-exists doNothing --trailer \ + "Signed-off-by: $NAME <$EMAIL>" \ + --in-place "$1" + +npm exec --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit index 57757f4e..1aa95fec 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npm run lint-staged +npm exec --no -- lint-staged --no-stash diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 20d0d06e..00000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run lint