Skip to content
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

Add shebang to run.js #528

Merged
merged 1 commit into from Jul 24, 2019
Merged

Add shebang to run.js #528

merged 1 commit into from Jul 24, 2019

Conversation

AluisioASG
Copy link
Contributor

Having just upgraded from 2.4.1, I've found that the hooks fail with Yarn support enabled:

$ HUSKY_DEBUG=1 git commit
husky:debug pre-commit hook started
husky:debug calling husky through Yarn
yarn run v1.17.0
$ […]/node_modules/.bin/husky-run pre-commit ''
[…]/node_modules/.bin/husky-run: 1: […]/node_modules/.bin/husky-run: /bin: Permission denied
[…]/node_modules/.bin/husky-run: 2: […]/node_modules/.bin/husky-run: Syntax error: "(" unexpected
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Looks like Yarn is trying to exec husky-run directly, while the npm codepath just runs it as a Node script. Adding a shebang fixes the issue.

Fixes running the hooks through Yarn (which doesn't call husky-run as a
script).
@typicode
Copy link
Owner

Thanks for the PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants