diff --git a/internal/templates/hook.tmpl b/internal/templates/hook.tmpl index 4a6c13c5..4511c18d 100644 --- a/internal/templates/hook.tmpl +++ b/internal/templates/hook.tmpl @@ -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}} $@"