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

Initializing with pnpm creates a pre-commit that always fails git commit #1473

Open
HAYASHI-Masayuki opened this issue Jul 20, 2024 · 3 comments

Comments

@HAYASHI-Masayuki
Copy link

When execute pnpm exec husky init, .husky/pre-commit will contain only pnpm, but pnpm, unlike yarn, will return 1 and exit when run without command line options. This causes git commit to always fail.

@typicode
Copy link
Owner

it doesn't create pnpm test?

@HAYASHI-Masayuki
Copy link
Author

Yes.
And there is no subcommand test in pnpm.

I thought, the operator precedence in this line of code might be wrong.

husky/bin.js

Line 18 in f6cc410

w('.husky/pre-commit', p.env.npm_config_user_agent?.split('/')[0] ?? 'npm' + ' test\n')

@thetigeregg
Copy link

Same with npx husky init. The default pre-commit just contains npm which fails in the same way.

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

No branches or pull requests

3 participants