Skip to content

Commit 8d14958

Browse files
committed
Fix path for searching npm-installed binary when in worktree (#193)
1 parent da72921 commit 8d14958

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cmd/templates/hook.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -t 1 ] ; then
88
exec < /dev/tty ; # <- enables interactive shell
99
fi
1010

11-
dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)"
11+
dir="$(git rev-parse --show-toplevel)"
1212

1313
call_lefthook()
1414
{

spec/fixtures/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -t 1 ] ; then
88
exec < /dev/tty ; # <- enables interactive shell
99
fi
1010

11-
dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)"
11+
dir="$(git rev-parse --show-toplevel)"
1212

1313
call_lefthook()
1414
{

spec/fixtures/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -t 1 ] ; then
88
exec < /dev/tty ; # <- enables interactive shell
99
fi
1010

11-
dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)"
11+
dir="$(git rev-parse --show-toplevel)"
1212

1313
call_lefthook()
1414
{

0 commit comments

Comments
 (0)