You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/bin/sh."$(dirname "$0")/_/husky.sh"echo"Doing step 1 of pre-commit hook"
npx ....
echo"Doing step 2 of pre-commit hook"
npx ...
What's the correct way to achieve this in v9?
If i remove the shebang header and . "$(dirname "$0") ..., then the hooks fails because it doesn't understand echo "...". If I put the shebang back in then seems to work ok..
#!/bin/shecho"Doing step 1 of pre-commit hook"
npx ....
echo"Doing step 2 of pre-commit hook"
npx ...
However, if I remove the _ directory (rm -rf .husky/_) and run npm run prepare (initialising husky), then the _ is re-created. Should I be sourcing this directory in the hook script (as before), or is it purely optional now?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In v8 etc we could put anything in the hook file
eg.
What's the correct way to achieve this in v9?
If i remove the shebang header and
. "$(dirname "$0") ...
, then the hooks fails because it doesn't understandecho "..."
. If I put the shebang back in then seems to work ok..However, if I remove the
_
directory (rm -rf.husky/_
) and runnpm run prepare
(initialising husky), then the_
is re-created. Should I be sourcing this directory in the hook script (as before), or is it purely optional now?Beta Was this translation helpful? Give feedback.
All reactions