From 3bd7d7e7a15b64adb365b7fe26383d9f81a27352 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Mon, 17 May 2021 20:55:11 +0300 Subject: [PATCH 1/2] Fix path for searching npm-installed binary when in worktree --- cmd/templates/hook.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/templates/hook.tmpl b/cmd/templates/hook.tmpl index 4648b028..ffc0738c 100644 --- a/cmd/templates/hook.tmpl +++ b/cmd/templates/hook.tmpl @@ -8,7 +8,7 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi -dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" +dir="$(git rev-parse --show-toplevel)" call_lefthook() { From 8eda9dbca7751b3e6a94a8659b5c9450b9f43f5f Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Tue, 18 May 2021 11:19:37 +0300 Subject: [PATCH 2/2] Fix specs --- spec/fixtures/pre-commit | 2 +- spec/fixtures/pre-push | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/fixtures/pre-commit b/spec/fixtures/pre-commit index 3d435141..53e4d47c 100644 --- a/spec/fixtures/pre-commit +++ b/spec/fixtures/pre-commit @@ -8,7 +8,7 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi -dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" +dir="$(git rev-parse --show-toplevel)" call_lefthook() { diff --git a/spec/fixtures/pre-push b/spec/fixtures/pre-push index 34d0b46b..2dcb5124 100644 --- a/spec/fixtures/pre-push +++ b/spec/fixtures/pre-push @@ -8,7 +8,7 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi -dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" +dir="$(git rev-parse --show-toplevel)" call_lefthook() {