That's a long title huh?
Anyway I got a combination of software I use with an issue that I cannot find the answer on the Internet.
At the time of writing, I use
- SourceTree 3.2.1
- Git (latest, version doesn't matter)
- lefthook 0.7.7 (as git hook manager)
- asdf with ruby plugin
I have hook scripts inside folder
./.githooks under project root (all version controlled)
git config core.hooksPath .githooks brew install lefthook
Workaround for source tree for path issue
sudo launchctl config user path `echo $PATH`
I have recently switched from RVM to asdf.
After a restart of my computer I realize that one of my git hooks running
bundle exec rubocop no longer works.
The workaround above works for RVM.
lefthookbinary is found (with workaround above)
bundleis using the binary from MacOS built-in Ruby
In my hook script
Add the following before the code running lefthook
# ASDF compatibility if test -f /usr/local/opt/asdf/libexec/asdf.sh ; then . /usr/local/opt/asdf/libexec/asdf.sh fi if test -f /opt/homebrew/opt/asdf/libexec/asdf.sh ; then . /opt/homebrew/opt/asdf/libexec/asdf.sh fi