Skip to content
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

Don't trigger hook when installed by tnpm #682

Closed
MondoGao opened this issue Mar 3, 2020 · 0 comments · Fixed by #687
Closed

Don't trigger hook when installed by tnpm #682

MondoGao opened this issue Mar 3, 2020 · 0 comments · Fixed by #687

Comments

@MondoGao
Copy link

MondoGao commented Mar 3, 2020

tnpm are largely used by Chinese developers in intranet enviroment, using them to install husky will cause $packageManager variable in .git/hooks/husky.local.sh equals to npminstall, thus hooks can't be trigger with following code in husky.sh

# Run husky-run with the package manager used to install Husky
case $packageManager in
"npm") run_command npx --no-install ;;
"pnpm") run_command pnpx --no-install ;;
"yarn") run_command yarn run --silent ;;
"*")
  echo "Unknown package manager: $packageManager"
  exit 0
  ;;
esac

and also the match all pattern should be * not "*"

@MondoGao MondoGao changed the title Don't trigger hook when installed by tnpm, cnpm Don't trigger hook when installed by tnpm Mar 3, 2020
afc163 added a commit to afc163/husky that referenced this issue Mar 10, 2020
typicode pushed a commit that referenced this issue Apr 9, 2020
* fix: cnpm fail cause packgeManager not matched

close #682
close #676
close cnpm/cnpm#318

* test: fix jest snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant