1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 07:13:53 -05:00

Merge pull request #1098 from blueyed/prefix-no-devnull

rbenv-prefix: do not silence rbenv-which for system version
This commit is contained in:
Mislav Marohnić
2018-08-09 16:11:47 +02:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -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:-/}"

View File

@@ -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
}