From a991a95389e4e1a045825cc50a1050ea42cafc65 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 4 Mar 2024 12:33:15 -0500 Subject: [PATCH] Switch to LEFTHOOK_BIN --- docs/usage.md | 6 +++--- internal/templates/hook.tmpl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 1964f96e..dec1bdf8 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -18,7 +18,7 @@ Then use git as usually, you don't need to reinstall lefthook when you change th - [`LEFTHOOK_EXCLUDE`](#lefthook_exclude) - [`LEFTHOOK_QUIET`](#lefthook_quiet) - [`LEFTHOOK_VERBOSE`](#lefthook_verbose) - - [`LEFTHOOK_PATH`](#lefthook_path) + - [`LEFTHOOK_BIN`](#lefthook_bin) - [Features and tips](#features-and-tips) - [Disable lefthook in CI](#disable-lefthook-in-ci) - [Local config](#local-config) @@ -193,9 +193,9 @@ SUMMARY: (done in 0.01 seconds) Set `LEFTHOOK_VERBOSE=1` or `LEFTHOOK_VERBOSE=true` to enable verbose printing. -### `LEFTHOOK_PATH` +### `LEFTHOOK_BIN` -Set `LEFTHOOK_PATH` to a location where lefthook is installed to use that instead of trying to detect it on the path or your package manager. +Set `LEFTHOOK_BIN` to a location where lefthook is installed to use that instead of trying to detect from the it the PATH or from a package manager. Useful for cases when: diff --git a/internal/templates/hook.tmpl b/internal/templates/hook.tmpl index 356a4a1e..d39490c8 100644 --- a/internal/templates/hook.tmpl +++ b/internal/templates/hook.tmpl @@ -19,9 +19,9 @@ call_lefthook() osArch=$(uname | tr '[:upper:]' '[:lower:]') cpuArch=$(uname -m | sed 's/aarch64/arm64/') - if test -n "$LEFTHOOK_PATH" + if test -n "$LEFTHOOK_BIN" then - "$LEFTHOOK_PATH" "$@" + "$LEFTHOOK_BIN" "$@" elif lefthook{{.Extension}} -h >/dev/null 2>&1 then lefthook{{.Extension}} "$@"