Skip to content

Commit

Permalink
Switch to LEFTHOOK_BIN
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles committed Mar 4, 2024
1 parent f348dfe commit a991a95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions internal/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}} "$@"
Expand Down

0 comments on commit a991a95

Please sign in to comment.