-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Husky replaces my "prepare" script #1387
Comments
Hi! For existing hooks, it's better to follow the 'How to migrate' section from https://github.com/typicode/husky/releases/tag/v9.0.1 I'll update docs to make that clearer. |
At least there should be a condition to check if prepare script has any commands in it or not If there is a command then this Like this - 14 ;(o.scripts ||= {}).prepare = 'husky'
+ 14 ;(o.scripts ||= {}).prepare = '' === (o.scripts ||= {}).prepare ? 'husky' : (o.scripts ||= {}).prepare + ' && husky' Raised the PR for the mentioned solution please check it out. |
Hi @SH4LIN, Maybe we experienced the same mistake. According to typicode's reply in PR #1407, the custom scripts should be placed in Hope this could make sense for you. |
Hi, |
Why is this not prioritized? This issue has blocked me to upgrade Husky. 😔 |
It does only three things that can be done manually:
https://typicode.github.io/husky/how-to.html#manual-setup Once these three steps are done, there's no need to run |
@typicode Thanks for the reply. I will go manual route then. I can live with running one extra command |
You're welcome, glad it's solved :) |
Context
Hi! Husky is working great so far, thanks for your time! But, when I run
pnpm exec husky init
, following the docs, it installs the hooks but also replaces myprepare
script withprepare: husky
. I understand the purpose of this behaviour, but if I have aprepare
script already, it should't replace it with its own script.It also replaces my repo pre-commit file inside of
/husky
with a default one that doespnpm test
. This is undesired behavior, because I already had a configuration written for the pre-commit hook.The text was updated successfully, but these errors were encountered: