husly pre push to git add dist?

53 views Asked by At

I have an npm package that need to build dist folder on every change. I'm stuck on creating the husky command in pre-push.

I have .husky/pre-push, but this doesn't work

npm run build && git add dist && git commit -m 'add dist' --no-verify && git push --no-verify

I got error of

nothing to commit, working tree clean
husky - pre-push hook exited with code 1 (error)
error: failed to push some refs
0

There are 0 answers