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

npx --no commitlint --edit command works fine? #1157

Closed
pers0n4 opened this issue Jun 13, 2022 · 3 comments · Fixed by #1164
Closed

npx --no commitlint --edit command works fine? #1157

pers0n4 opened this issue Jun 13, 2022 · 3 comments · Fixed by #1164

Comments

@pers0n4
Copy link
Contributor

pers0n4 commented Jun 13, 2022

Context

  • Ubuntu 18.04
  • zsh 5.4.2
  • Node v16.14.2
  • pnpm v7.2.1

I added a commit-msg hook as described in document

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no commitlint --edit $1

But this script failed with an error

[input] reads from stdin if --edit, --env, --from and --to are omitted
# ...
[input] is required: supply via stdin, or --env or --edit or --from and --to
husky - commit-msg hook exited with code 1 (error)

I solved this problem by fixing the script as follows.

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1

Does this command(npx --no commitlint --edit $1) work for others without any problems?

@lichong-a
Copy link

I also encountered this problem. The document needs to be updated

@typicode
Copy link
Owner

@pers0n4 thanks for heads up, I'm experiencing the same issue. Do you want to make a PR with the fix?

@pers0n4
Copy link
Contributor Author

pers0n4 commented Jun 17, 2022

@typicode Yes, I will create a PR that changes the document

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 a pull request may close this issue.

3 participants