From 53cb90d6839a98aa460a85e949bdc2c5e8114996 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Wed, 28 Feb 2024 08:23:42 -0500 Subject: [PATCH] add support to giving an explicit path to lefthook in git hook. useful for developing --- internal/templates/hook.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/templates/hook.tmpl b/internal/templates/hook.tmpl index fc9fd240..356a4a1e 100644 --- a/internal/templates/hook.tmpl +++ b/internal/templates/hook.tmpl @@ -19,7 +19,10 @@ call_lefthook() osArch=$(uname | tr '[:upper:]' '[:lower:]') cpuArch=$(uname -m | sed 's/aarch64/arm64/') - if lefthook{{.Extension}} -h >/dev/null 2>&1 + if test -n "$LEFTHOOK_PATH" + then + "$LEFTHOOK_PATH" "$@" + elif lefthook{{.Extension}} -h >/dev/null 2>&1 then lefthook{{.Extension}} "$@" {{if .Extension -}}