-
-
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
Hook should fail if command is not found #715
Comments
Very good suggestion. Due to Husky breaking changes (actually, I'd rather consider it a regression) after moving to husky 4 all the commit hooks just started to be skipped suddenly when doing commit through SourceTree. It took me quite a while to figure out what's going on. |
Some other related issues: This seems like it should be the default behaviour. If the environment does not provide the necessary commands it shouldn't skip the hook. Uninitiated developers with improper environment setups should not be allowed to commit since many of the tools that are run by husky are purposed for this same group of people. |
Same here with husky 4, Sourcetree, and MacOs. I moved back to husky 3.1.0. Any solution? |
Same here. Wondering why hooks did not run using Fork.app on Mac. Downgrading to 3.1.0 fixed this. Feels like a regression to me. |
Behavior is changed in v5 and it will fail if a command is missing. |
Husky should fail a hook if the package manager husky is configured to run cannot be found.
The reason this came up is that SourceTree has an issue with the PATH not including /usr/local/bin on MacOS by default. So if a developer doesn't have SourceTree setup correctly it will commit the change since the hook is skipped by Husky when the command is not found.
See this related SourceTree issue.
https://jira.atlassian.com/browse/SRCTREE-7184
Other related husky issues:
#390
#639
Shouldn't the hook error (exit 1) if the command is not found instead of skipping the hook?
husky/sh/husky.sh
Lines 25 to 28 in 85a4704
In the example below I am trying to list my project using a yarn script as a pre-commit hook but I purposely removed yarn from my PATH.
The text was updated successfully, but these errors were encountered: