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
It looks like that bash scripts cannot be run with lefthook in a Windows environment.
The same config and script work fin in WSL and also with a js script and node.
But on Windows, there is a bash error: No such file or directory.
This is possibly due to a character escape issue.
I actually do not know if this should even be possible, but due to the nature of the error I think it should be, since node runs, but has a wrong path to the script.
Run npm i (which should also install the git hooks)
Run npx lefthook -v run prepare-commit-msg
Expected results
The console should print "hello from bash".
Actual results
The console prints an error instead:
RUNNING HOOK: prepare-commit-msg ⠙ waiting: bash.sh/bin/bash: F:Devplaygroundlefthook.lefthookprepare-commit-msgbash.sh: No such file or directory
-> note the missing folder delimiters (/ or )
I second this, having the same error where bash seems to be called with a windows-style path containing no slash (neither forward nor backward), when called from powershell.
This is unfortunately a blocker for lefthook adoption.
🔧 Summary
It looks like that bash scripts cannot be run with lefthook in a Windows environment.
The same config and script work fin in WSL and also with a js script and node.
But on Windows, there is a bash error:
No such file or directory
.This is possibly due to a character escape issue.
I actually do not know if this should even be possible, but due to the nature of the error I think it should be, since node runs, but has a wrong path to the script.
Lefthook version
1.4.11
Steps to reproduce
npm i
(which should also install the git hooks)npx lefthook -v run prepare-commit-msg
Expected results
The console should print "hello from bash".
Actual results
The console prints an error instead:
RUNNING HOOK: prepare-commit-msg
⠙ waiting: bash.sh/bin/bash: F:Devplaygroundlefthook.lefthookprepare-commit-msgbash.sh: No such file or directory
-> note the missing folder delimiters (/ or )
Possible Solution
Logs / Screenshots
The text was updated successfully, but these errors were encountered: