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
Issue with path resolution on Windows #1397
Comments
+1 I have a similar problem. I use GitKraken which uses WSL to execute its git commands, but I selected the Windows installed Git executable. The following script inside all of the default hook files
works on my Windows terminal but not through GitKraken because it uses the Windows path separator |
+1 for gitkraken issue |
|
I have issue like this, when I did upgrade from v8 to v9 According to migration guide paths to husky.sh should be removed v8:
v9: But if remove the path, it works on MAC/Unix, but on Windows I can't commit anymore error: cannot spawn desktop/.husky/pre-commit: No such file or directory |
I have created a PR that fixes the issue on my end: #1402 |
Thanks for the report. @hyperupcall do you have any thoughts on this? I find this behavior surprising as I'm not aware of other Git GUI tools on Windows having this issue? |
I'm facing the exact same issue as @sergei-lobanov mentioned above. I'm using Windows 10. When I restore these two script lines:
It works again perfectly as it did, even after keeping the change of Should I update to v9 with these scripts restored? Please advise. cc @typicode |
Any news on this issues? |
I have the same problem. It is not working in SourceTree and not in VS Code. When adding the lines back, it works. |
Same here on Windows 10 with Webstorm |
Hi. After upgrading to version 9 from 8 hooks on windows stopped working. Based on some quick debugging it seems that path to the actual script is not being resolved correctly. To confirm this i echo'ed script path in
h
file:which gives me this output:
Notice that path contains both forward and back slashes and because of that
s="${0%/*/*}/$h"
returns incorrect path.Could it be something with my setup or the regexp needs to be updated ?
OS:
Microsoft Windows [Version 10.0.19045.4046]
The text was updated successfully, but these errors were encountered: