For Husky pre-push hook, how can I make "echo" command to display information in VSCode Output?

755 Views Asked by At

I have 2 Husky hooks: pre-commit and pre-push. In both hooks, I use echo to print out progress information and call tasks such as build and test. While the pre-commit hook prints the output as expected (both the echo as well as the tasks output), nothing is printed when the pre-push hook is called. Why is that?

1

There are 1 best solutions below

0
Yuriy Rybin On

Does pre-push hook work at all? I had the same issue but it turned out that the hook wasn't triggered because I created pre-push file in the VS Code. Removing the file and adding it in the terminal(npx husky add .husky/pre-push "echo 'Husky started...'") fixed my issue