evilmartians/lefthook

Installation command creates a folder named --help

sawa-ko opened this issue · 5 comments

🔧 Summary

When I run the command lefthook install (using pnpm exec) a folder named --help is created.

Lefthook version

1.7.2

Steps to reproduce

  1. Install lefthook
  2. Use the command lefthook install
  3. See the --help folder created by lefthook

Expected results

Some .lefthook folder or something like that and not a folder named --help.

Actual results

A folder named --help

Possible Solution

Logs / Screenshots

Grabacion.de.pantalla.2024-07-11.135913.mp4
LEFTHOOK_VERBOSE=true git ...

Hey! Could you share your lefthook.yml config?

Hi @mrexox, here my lefhook.yml file

pre-commit:
  parallel: true
  commands:
    check:
      glob: "*.{ts,tsx}"
      run: npx lint-staged --allow-empty && git update-index --again

commit-msg:
  scripts:
    "commitlint.sh":
      runner: bash

post-commit:
  commands:
    git-update-index:
      run: git update-index --again

Thank you. Could you please show what this git command displays?

git rev-parse --git-path hooks

I assume that hooks path may be configured the wrong way, because this bug does not reproduces for my local setup.

Hi @mrexox, the response of the command is this:

image

@sawa-ko , I think you should setup your hooksPath setting for the project or globally.

Consider chaning --local to --global if the setting is global. I think that this configuration may be either in yout ~/.gitconfig or in your project's .git/config file.

git config --local core.hooksPath .git/hooks/