From 806f3f6ae2947b962bd5ee989de105f58b39660d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 13 Jul 2018 18:48:06 +0200 Subject: [PATCH] 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 --- libexec/rbenv-prefix | 2 +- test/prefix.bats | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libexec/rbenv-prefix b/libexec/rbenv-prefix index e65be83443..d583e1b1c0 100755 --- a/libexec/rbenv-prefix +++ b/libexec/rbenv-prefix @@ -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:-/}" diff --git a/test/prefix.bats b/test/prefix.bats index bdee6f060d..9a89910b89 100644 --- a/test/prefix.bats +++ b/test/prefix.bats @@ -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 <