Skip to content

Commit

Permalink
fix: use correct extension in hook.tmpl (#767)
Browse files Browse the repository at this point in the history
After using 'range' '.Extension' cant be accessed on the resulting string.
Two places where missed where this lead to a problem. They were replaced in
this PR.
  • Loading branch information
apfohl authored Jul 8, 2024
1 parent c46108e commit f997887
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ call_lefthook()
"$dir/node_modules/lefthook/bin/index.js" "$@"
{{ $extension := .Extension }}
{{- range .Roots -}}
elif test -f "$dir/{{.}}/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook{{.Extension}}"
elif test -f "$dir/{{.}}/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook{{$extension}}"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook{{.Extension}}" "$@"
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook{{$extension}}" "$@"
elif test -f "$dir/{{.}}/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook{{$extension}}"
then
"$dir/{{.}}/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook{{$extension}}" "$@"
Expand Down

0 comments on commit f997887

Please sign in to comment.