Skip to content

Commit

Permalink
Merge pull request #1098 from blueyed/prefix-no-devnull
Browse files Browse the repository at this point in the history
rbenv-prefix: do not silence rbenv-which for system version
  • Loading branch information
mislav committed Aug 9, 2018
2 parents 1c772d5 + 806f3f6 commit 59785f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libexec/rbenv-prefix
Expand Up @@ -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:-/}"
Expand Down
5 changes: 4 additions & 1 deletion test/prefix.bats
Expand Up @@ -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
}

0 comments on commit 59785f6

Please sign in to comment.