From f997887f3ed9cdfa5e8b61dd36cb748d503ae8aa Mon Sep 17 00:00:00 2001 From: Andreas Pfohl Date: Mon, 8 Jul 2024 16:35:48 +0200 Subject: [PATCH] fix: use correct extension in hook.tmpl (#767) 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. --- internal/templates/hook.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/templates/hook.tmpl b/internal/templates/hook.tmpl index 97237962..2296d98c 100644 --- a/internal/templates/hook.tmpl +++ b/internal/templates/hook.tmpl @@ -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}}" "$@"