-
-
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
It's failed in git GUI #1041
Comments
This is a blithering awful issue description. But, he's right. Hooks work perfectly in the CLI, but not in "GUI", and for me the GUI means GitKraken. I've also reported it to them. The precommit hook, at least, does get executed when committing from within VScode (graphically, not the CLI in VScode... obviously) so I'm guessing GitKraken is doing something wrong. How the hell they convince Git to commit without executing hooks? Your guess is as good as mine, but they are definitely messing something up. And this may be the case for @NSGUF as well, even with that much detailed information and environmental context. |
It's a known issue on GitKraken Unfortunately nothing that could be done on husky's side. As for the other problem, I'd suggest checking https://typicode.github.io/husky/#/?id=command-not-found as it's often a PATH problem. |
It's a regression that the Husky maintainers just don't want to fix. See: #639 |
Seems to be fixed in GitKraken 8 |
Nice, thanks for staying on the ball 🙂 |
I had this issue with v4 and followed the solution provided by @typicode here: This issue has resurfaced with v7 and it appears the recommended contents of ~/.huskyrc has since changed: https://typicode.github.io/husky/#/?id=command-not-found Updating
|
Another workaround I found is a little bash file to fill in the .git/hooks files and make them run the husky hooks: #!/bin/sh
# ./hook_setup.sh
set -e
HERE=$(realpath $(dirname "$0"))
GITDIR="$HERE/.git"
HOOKDIR="$GITDIR/hooks"
HUSKY_HOOKS="$HERE/.husky"
for F in `ls "$HUSKY_HOOKS"`; do
P="$HUSKY_HOOKS/$F"
if [ -f "$P" ] ; then
HOOK_FILE="$HOOKDIR/$F"
echo "#!/bin/sh" > "$HOOK_FILE"
echo "sh \"$P\"" >> "$HOOK_FILE"
chmod +x "$HOOK_FILE"
fi
done then call it in the {
"scripts": {
"prepare": "husky install && sh hook_setup.sh"
}
} |
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. |
still an issue |
I'm going to close this issue as it seems to be fixed in GitKraken now: As for why it doesn't work in GUI (and how to fix it) the article explains it very well:
If you install node globally (without nvm) you shouldn't have this issue though. |
I'm not using nvm :) |
I'm also not using nvm. I have Node and npm installed globally via Homebrew. Nothing fancy about the setup, just the default installation location. Husky doesn't work in any GUI with a default Node install. |
@Naddiseo I see @sholladay have you tried also https://docs.brew.sh/FAQ#my-mac-apps-dont-find-homebrew-utilities? |
No, because:
|
It's failed in git GUI
when i use GUI, eslint failed, but commit succeeded;
westorm、vscode、terminal can intercept,but gui can't;
"husky": "^7.0.1",
The text was updated successfully, but these errors were encountered: