difficulty ensuring lefthook runs if you use through bundler in some places, but homebrew in others #727
technicalpickles
started this conversation in
General
Replies: 1 comment 1 reply
-
I started drafting this to propose a solution to this, but figure I should describe the problem first! I think one way that could help our teams' usage is to also check for If the hook script did that, and I manage lefthook through bundler and have a binstub, it should always run the right version. I'm not sure what other frameworks do re binstubs. I was also thinking this could be an opportunity to make |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hooks will try to run lefthook a number of ways:
https://github.com/evilmartians/lefthook/blob/master/internal/templates/hook.tmpl#L22-L70
In practice, I've noticed it can be a challenge to make sure the right lefthook runs if you use a version manager that uses shims (ie nodenv, rbenv, asdf, etc) for some projects, and have a system-wide installed lefthook for others.
For example, if
gem install lefthook
at some point, I have this on the front of my PATH:Assuming I
bundle install
, it's not a problem to run in a project that bundled it. The problem is when I go elsewhere, and the PATH is the same... except the right version might not be installed for ruby:Beta Was this translation helpful? Give feedback.
All reactions