Is it possible to set up two precommit hooks with husky? Specifically, I want to integrate commitlint along with a custom script specified in my package.json. After installing husky and creating a pre-commit script in the .husky folder, here is what I have attempted:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx commitlint --edit
npm run mycommand
I tested
npx commitlint --edit && npm run mycommand
as well as removing the commitlint command from this file and adding a second file named commit-msg
in my .husky folder with the following content:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx commitlint --edit $1
Although the custom command runs successfully, commitlint does not validate the message. How can I ensure that commitlint runs along with my custom command?