Restore rbenv support

This commit is contained in:
Loic Nageleisen 2021-01-06 13:52:43 +01:00
parent a59d208b9d
commit 8acf539dc8
2 changed files with 12 additions and 4 deletions

14
shell/rbenv Normal file → Executable file
View file

@ -1,9 +1,17 @@
# rbenv
# vim: ft=sh
# shellcheck shell=bash
test -d "/opt/rbenv" && RBENV_ROOT="/opt/rbenv"
test -d "$HOME/.rbenv" && RBENV_ROOT="$HOME/.rbenv"
export RBENV_ROOT
[[ -n "$RBENV_ROOT" ]] && PATH="$RBENV_ROOT/bin:$PATH"
which rbenv 2>&1 >/dev/null && eval "$(rbenv init -)"
export PATH
_has-rbenv() {
type rbenv >/dev/null 2>&1
}
if _has-rbenv; then
eval "$(rbenv init -)"
export PATH
fi

View file

@ -8,7 +8,7 @@ _gem_home() {
export PATH
}
if ! _has-chruby; then
if ! _has-chruby && ! _has-rbenv; then
_gem_home
fi