Skip to content

Commit

Permalink
fix: Check for lefthook.bat in hook template (#316)
Browse files Browse the repository at this point in the history
* fix: Check for lefthook.bat in hook template

Signed-off-by: Valentin Kiselev <[email protected]>

* chore: Use go template instead of sh checks

Signed-off-by: Valentin Kiselev <[email protected]>
  • Loading branch information
mrexox authored Aug 10, 2022
1 parent 66a5ea2 commit 5c83629
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ call_lefthook()
if lefthook{{.Extension}} -h >/dev/null 2>&1
then
eval lefthook{{.Extension}} $@
{{if .Extension -}}
{{/* Check if lefthook.bat exists. Ruby bundler creates such a wrapper */ -}}
elif lefthook.bat -h >/dev/null 2>&1
then
eval lefthook.bat $@
{{end -}}
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}"
then
eval "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}} $@"
Expand Down

0 comments on commit 5c83629

Please sign in to comment.