浏览代码

Prevent duplicate PATH entries when bin_path/.. is the same as PYENV_ROOT (#2045)

pull/2071/head
Pamela McA'Nulty 4 年前
提交者 GitHub
父节点
当前提交
1c90a0f864
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. +7
    -3
      libexec/pyenv

+ 7
- 3
libexec/pyenv 查看文件

@ -80,9 +80,13 @@ bin_path="$(abs_dirname "$0")"
for plugin_bin in "${bin_path%/*}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
# PYENV_ROOT can be set to anything, so it may happen to be equal to the base path above,
# resulting in duplicate PATH entries
if [ "${bin_path%/*}" != "$PYENV_ROOT" ]; then
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
fi
export PATH="${bin_path}:${PATH}"
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${PYENV_ROOT}/pyenv.d"

正在加载...
取消
保存