Should list all "installed" git hooks by lefthook (all files not matching *.sample
Possible Solution
I tried on the same Repo, same commit history, with npm and it works as expected, but not with pnpm. Even if i put enable-pre-post-scripts = true to the .npmrc within the repo, it does not get executed.
What did fix it for me was to add side-effects-cache = false to the .npmrc located in the git repository.
So i am not sure if its actually a bug with lefthook, but maybe it should get noted somewhere in your docs that the cache could prevent the installation of lefthook.
:wrench: Summary
If i run
pnpm install
in a freshly cloned git repo thepostinstall
script of lefthook gets not executed locally.Lefthook version
1.6.18 4ea200b04d374ba1bb9f66a940430309a2838d27
Steps to reproduce
git clone <repo> target-dir
cd target-dir
pnpm install
Expected results
Configured git hooks in
lefthook.yaml
should be correctly installed in.git/hooks
, resulting in git hooks getting triggered correctly.Actual results
Should list all "installed" git hooks by lefthook (all files not matching
*.sample
Possible Solution
I tried on the same Repo, same commit history, with
npm
and it works as expected, but not with pnpm. Even if i putenable-pre-post-scripts = true
to the .npmrc within the repo, it does not get executed.What did fix it for me was to add
side-effects-cache = false
to the.npmrc
located in the git repository.So i am not sure if its actually a bug with lefthook, but maybe it should get noted somewhere in your docs that the cache could prevent the installation of lefthook.