mirror of
https://github.com/rbenv/rbenv.git
synced 2024-12-28 20:55:38 +01:00
rbenv-prefix: do not silence rbenv-which for system version
This suppressed any output when using RBENV_DEBUG=1 and does not really hurt to have in the unlikely case that it should fail; you would get two error messages now: rbenv: ruby: command not found rbenv: system version not found in PATH
This commit is contained in:
parent
1c772d5ff2
commit
806f3f6ae2
2 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,7 @@ elif [ -z "$RBENV_VERSION" ]; then
|
|||
fi
|
||||
|
||||
if [ "$RBENV_VERSION" = "system" ]; then
|
||||
if RUBY_PATH="$(rbenv-which ruby 2>/dev/null)"; then
|
||||
if RUBY_PATH="$(rbenv-which ruby)"; then
|
||||
RUBY_PATH="${RUBY_PATH%/*}"
|
||||
RBENV_PREFIX_PATH="${RUBY_PATH%/bin}"
|
||||
echo "${RBENV_PREFIX_PATH:-/}"
|
||||
|
|
|
@ -38,5 +38,8 @@ OUT
|
|||
|
||||
@test "prefix for invalid system" {
|
||||
PATH="$(path_without ruby)" run rbenv-prefix system
|
||||
assert_failure "rbenv: system version not found in PATH"
|
||||
assert_failure <<EOF
|
||||
rbenv: ruby: command not found
|
||||
rbenv: system version not found in PATH"
|
||||
EOF
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue