-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Win 10 Github Desktop pre-commit hook #1072
Comments
Hmm that's weird, nowhere husky is calling |
It seems that I'm not the only one. Someone else also opened an issue for the desktop app desktop/desktop #13307 & desktop/desktop #12562 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Same here 😞. I'm using from Github desktop. Vscode is fine. But i like github desktop My environment OS: Windows 11 latest |
This reverts commit d0f3b6d. - Experiencing issues with commits in GitHub desktop. - Issues appear to have no non-hacky fix. - So reverting changes. - see typicode/husky#1072 - see desktop/desktop#12562 - see desktop/desktop#9351
It is not Github Desktop I am using here but Visual Studio 2022 which gives me the exact same error. While Googling, I did come across issue #1038 and there are some suggestions in there. Did try to change my .husky/commit-msg from
to
And Visual Studio 2022 did give me the message Next I made sure that in my system PATH environment variable I do have Any other suggestions? |
Hmm I'm not using Windows enough to help here. However I have GitHub Desktop 2.9.8 working. I also have Git installed with Git Bash on my machine. I don't see what could be done on husky's side in terms of code. |
I guess it is just Visual Studio which is acting weird here. Currently my workaround is to use Visual Studio Code to commit code which works just fine. Still if anyone else knows what is going on here, or has a suggestion of fixing or logging this elsewhere, give a shout. |
Closing to clean up issues list, but if anyone has fix ideas feel free to add to this thread. |
This issue is still a thing and i can confirm this issue as described the latter. |
Not for the issue, only a work around. If you go back to node 14 the issue should not appear. |
hmmmmmmmmmmmmmmmm~ i will try tomorrow (hopefully) and report back! |
maybe @typicode has some more information about this issue in the meantime?! Would it help, if we provide a minimal reproduction repository? |
@johannesschobel no more info, sorry :/ |
@chall2chall4 is the code repository located within a wsl2 distro? @typicode : would you be willing to help and track down the issue in order to solve this problem? |
I am using node 14 and I get the issue so I don't think that's a universal solution |
No, this is just a deployed repository on my windows 11. Specifically taken from here: https://github.com/electron-react-boilerplate/electron-react-boilerplate |
I added Then as a rule I write |
Leaving my two cents here, I solved the issue by adding .cmd to the npx call in .husky/pre-commit: #!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx.cmd lint-staged Wild guess: I noticed I have both a "npx" and "npx.cmd" files in C:/Program Files/nodejs, and they are ordered alphabetically. IIRC, Windows pathing matchs the first file, which turns out to be the one without extension (probably a Linux binary from WSL). Again, wild guess, but maybe WSL is messing around in the issue. |
|
OMG thank you! Here's my variant:
|
This fix so very nearly works for me but I'd been using regex as part of my command for prettier: Which I can't seem to get to work inside husky for the life of me, so for now at least I've given up trying to make GitHub desktop work and just using the VSCode source control |
* Fix husky pre-commit on some Windows clients typicode/husky#1072 (comment) * Limit commit type check to staged files Adds tsc-files package (dev only) and its config * Remove deprecated git add from lint-staged
Hello, I have a problem with my pre-commit hook or husky in general when using Github Desktop.
On the first look, it seems to be #1038, but the problem is. It works perfectly fine in VS code.
My environment:
Terminal or GUI client: GitHub Desktop v2.9.4 (x64)
System OS: Windows 10
Node Version: v15.14.0
npm Version: 7.7.6
I followed the following guide
https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v7
After that, I have now
"husky": "^7.0.4"
in place and get the following error message:Do I have to configure something in the pre-commit file?
The text was updated successfully, but these errors were encountered: