1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 22:33:52 -05:00

Avoid rbenv-exec calling out to rbenv-version-name twice

Running any shim (and thus `rbenv-exec`) would always execute
`rbenv-version-name` twice: once in `rbenv-exec` and another time in
`rbenv-which`, even though RBENV_VERSION variable would have already
been populated at this point.

Now RBENV_VERSION is respected within `rbenv-which`.
This commit is contained in:
Mislav Marohnić
2014-10-13 03:11:12 +02:00
parent 51bd975820
commit 6bb7f07d2d
2 changed files with 14 additions and 1 deletions

View File

@@ -72,3 +72,12 @@ SH
assert_success
assert_output "HELLO=:hello:ugly:world:again"
}
@test "discovers version from rbenv-version-name" {
mkdir -p "$RBENV_ROOT"
cat > "${RBENV_ROOT}/version" <<<"1.8"
create_executable "1.8" "ruby"
RBENV_VERSION= run rbenv-which ruby
assert_success "${RBENV_ROOT}/versions/1.8/bin/ruby"
}