-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash scripts fails on Windows but work on WSL #551
Comments
Thank you for this catch! I will take a look at this issue this week. |
BTW, could you remove the |
I changed the config like so (is this what you meant be removing the runner?):
This results in the following error:
This is probably caused due to windows not containing bash!? Note: I ran this on a different PC. I will check again later. |
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. |
Also wanted to run shell script on windows but it's blocked. |
🔧 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: