pyenv-prefix returns wrong prefix if system is given in the middle of arguments.

This commit is contained in:
Yamashita Yuu 2013-06-04 17:35:23 +09:00
parent b4ba76a15a
commit 319000b448

View file

@ -26,7 +26,7 @@ fi
PYENV_PREFIX_PATHS=() PYENV_PREFIX_PATHS=()
for version in "${versions[@]}"; do for version in "${versions[@]}"; do
if [ "$version" = "system" ]; then if [ "$version" = "system" ]; then
PYTHON_PATH="$(pyenv-which python || true)" PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python || true)"
PYENV_PREFIX_PATH="${PYTHON_PATH%/*}" PYENV_PREFIX_PATH="${PYTHON_PATH%/*}"
else else
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}" PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}"