Merge pull request #1093 from blueyed/which

rbenv-which: change PATH only for the "command -v" lookup
This commit is contained in:
Mislav Marohnić 2018-06-07 23:41:38 +02:00 committed by GitHub
commit 1c772d5ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,8 +37,8 @@ fi
RBENV_VERSION="${RBENV_VERSION:-$(rbenv-version-name)}" RBENV_VERSION="${RBENV_VERSION:-$(rbenv-version-name)}"
if [ "$RBENV_VERSION" = "system" ]; then if [ "$RBENV_VERSION" = "system" ]; then
PATH="$(remove_from_path "${RBENV_ROOT}/shims")" PATH="$(remove_from_path "${RBENV_ROOT}/shims")" \
RBENV_COMMAND_PATH="$(command -v "$RBENV_COMMAND" || true)" RBENV_COMMAND_PATH="$(command -v "$RBENV_COMMAND" || true)"
else else
RBENV_COMMAND_PATH="${RBENV_ROOT}/versions/${RBENV_VERSION}/bin/${RBENV_COMMAND}" RBENV_COMMAND_PATH="${RBENV_ROOT}/versions/${RBENV_VERSION}/bin/${RBENV_COMMAND}"
fi fi