-
Notifications
You must be signed in to change notification settings - Fork 541
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
[Dev] Make nodejs pre-commit
hook more resilient
#6836
Conversation
Hi @paulcam206. This pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along. |
Staleness reset by paulcam206 |
@licanhua - looks like the clang-format task is failing... why does it care about package-lock.json? |
|
Co-authored-by: Canhua Li <licanhua@live.com>
Description
Fix up a small issue with the new
pre-commit
hook that I encountered -- it's possible to get into a state where the client hook is registered, buthusky
itself isn't installed:cd source/nodejs && npm i
git clean -dxf .
touch ../android/commit-me.txt && git add --all && git commit -m "test commit"
At this point, the hook will execute, but since
source/nodejs/.husky/_/husky.sh
doesn't exist (wiped bygit clean
), the hook will fail here and prevent the commit.The fix is to change the
pre-commit
hook to only apply ifhusky
is in a good state.Microsoft Reviewers: Open in CodeFlow