Skip to content

Commit 2028b5c

Browse files
author
Mike Foley
committed
Update RVM shell commands
When finding a Ruby command these are now tried in order: 1. rbenv 2. rvm 3. rvm legacy 4. system ruby Fixes #23
1 parent 1878e3b commit 2028b5c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

templates/hooks/commit-msg

+9-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ if [ -z "$GIT_BRANCH_NAME" ]; then
2626
exit 0
2727
fi
2828

29-
if which rvm > /dev/null 2>&1
30-
then cmd="rvm default do ruby"
31-
elif which rbenv > /dev/null 2>&1
32-
then cmd="rbenv exec ruby"
33-
else cmd="ruby"
29+
# find appropriate Ruby command
30+
if which rbenv > /dev/null 2>&1; then
31+
cmd="rbenv exec ruby"
32+
elif which ruby-rvm-env > /dev/null 2>&1; then
33+
cmd="ruby-rvm-env"
34+
elif which rvm > /dev/null 2>&1; then
35+
cmd="rvm default do ruby"
36+
else
37+
cmd="ruby"
3438
fi
3539

3640
# allow user input if running in a terminal

0 commit comments

Comments
 (0)