Skip to content

Commit

Permalink
feature: Use pnpm before npx (#393)
Browse files Browse the repository at this point in the history
Closes #250
  • Loading branch information
mrexox committed Dec 12, 2022
1 parent a1ffd9b commit c5fc306
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,24 @@ call_lefthook()
then
eval lefthook.bat $@
{{end -}}
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
eval "$dir/node_modules/lefthook/bin/index.js $@"
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}} $@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}"
then
eval "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}} $@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
eval "$dir/node_modules/lefthook/bin/index.js $@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook $@
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook $@
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook $@
elif npx @evilmartians/lefthook -h >/dev/null 2>&1
then
npx @evilmartians/lefthook $@
Expand Down

0 comments on commit c5fc306

Please sign in to comment.