From 016a10bf4862ec3dba58f4011089e97571407942 Mon Sep 17 00:00:00 2001 From: Svyatoslav Kryukov Date: Wed, 12 May 2021 15:14:55 +0300 Subject: [PATCH] Add .lefthookrc loading --- CHANGELOG.md | 4 ++++ cmd/templates/hook.tmpl | 4 ++++ spec/fixtures/pre-commit | 4 ++++ spec/fixtures/pre-push | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a17f9ef2..cdcb6da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +- [PR](https://github.com/evilmartians/lefthook/pull/185) Add `.lefthookrc` to fix incorrect PATH @skryukov +- [PR](https://github.com/evilmartians/lefthook/pull/182) Support git workspaces and submodules @skryukov + + # 0.7.4 (2021-04-30) - [PR](https://github.com/evilmartians/lefthook/pull/171) Improve check for installed git @DmitryTsepelev diff --git a/cmd/templates/hook.tmpl b/cmd/templates/hook.tmpl index 4648b028..27865248 100644 --- a/cmd/templates/hook.tmpl +++ b/cmd/templates/hook.tmpl @@ -8,6 +8,10 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi +if [ -f ~/.lefthookrc ]; then + source ~/.lefthookrc +fi + dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" call_lefthook() diff --git a/spec/fixtures/pre-commit b/spec/fixtures/pre-commit index 3d435141..b19cc291 100644 --- a/spec/fixtures/pre-commit +++ b/spec/fixtures/pre-commit @@ -8,6 +8,10 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi +if [ -f ~/.lefthookrc ]; then + source ~/.lefthookrc +fi + dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" call_lefthook() diff --git a/spec/fixtures/pre-push b/spec/fixtures/pre-push index 34d0b46b..ffa59f1f 100644 --- a/spec/fixtures/pre-push +++ b/spec/fixtures/pre-push @@ -8,6 +8,10 @@ if [ -t 1 ] ; then exec < /dev/tty ; # <- enables interactive shell fi +if [ -f ~/.lefthookrc ]; then + source ~/.lefthookrc +fi + dir="$(cd "$(dirname "$(dirname "$(dirname "$0")")")" >/dev/null 2>&1 || exit ; pwd -P)" call_lefthook()