You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing an issue as someone who installed lefthook globally as recommended if you follow the instructions blindly...
I can see in a procmon trace that the hook tries to execute lefthook through bundler, which results in a command line like C:\Ruby31-x64\bin\ruby.exe -x C:/Ruby31-x64/bin/bundle exec lefthook -h, but I have no such gem installed in the project. I can run lefthook manually with no problem, its in my PATH.
Very annoyingly, if I run git push, it gets to echo "Can't find lefthook in PATH", but my console just hangs, nothing happening until I break into it (which exits). I have no idea why that happens.
I have no Lefthook.exe, only a lefthook.bat at "C:\Ruby31-x64\bin\lefthook.bat", so that's why it skips the first line.
I presume the easiest fix for me will be to add lefthook in my bundle. Someone else will surely hit this.
The text was updated successfully, but these errors were encountered:
Hey @ariccio! The problem is that we assume that on Windows lefthook has actually lefthook.exe file as executable. But is seems like Ruby creates a wrapper lefthook.bat which executes a binary from the gem.
I would suggest installing lefthook with go install github.com/evilmartians/lefthook@latest instead of globally installed gem. This should fix the issue.
I will add a check for lefthook.bat for Windows also, and it should fix the problem.
I am seeing an issue as someone who installed lefthook globally as recommended if you follow the instructions blindly...
I can see in a procmon trace that the hook tries to execute lefthook through bundler, which results in a command line like
C:\Ruby31-x64\bin\ruby.exe -x C:/Ruby31-x64/bin/bundle exec lefthook -h
, but I have no such gem installed in the project. I can run lefthook manually with no problem, its in my PATH.Very annoyingly, if I run
git push
, it gets toecho "Can't find lefthook in PATH"
, but my console just hangs, nothing happening until I break into it (which exits). I have no idea why that happens.I have no
Lefthook.exe
, only alefthook.bat
at"C:\Ruby31-x64\bin\lefthook.bat"
, so that's why it skips the first line.I presume the easiest fix for me will be to add lefthook in my bundle. Someone else will surely hit this.
The text was updated successfully, but these errors were encountered: