mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 07:16:18 -04:00
+ refactor notes
This commit is contained in:
parent
006e79891b
commit
adc9e5e2a1
|
|
@ -54,8 +54,12 @@ for version in "${versions[@]}"; do
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Calling pyenv-prefix is expensive. Only do so if the path doesn't exist.
|
||||
# See https://github.com/pyenv/pyenv-virtualenv/pull/502
|
||||
# In the vast majority of cases, there's a direct match and
|
||||
# not spawning `pyenv-prefix' saves about half the invocation time
|
||||
# with a signle argument which accumulates when called repeatedly
|
||||
# (e.g. from `pyenv-virtualenvs').
|
||||
# `pyenv-prefix' also does not have hooks to worry about.
|
||||
# XXX: refactor the test into a shared module?
|
||||
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}"
|
||||
if [[ ! -d "$PYENV_PREFIX_PATH" ]]; then
|
||||
PYENV_PREFIX_PATH="$(pyenv-prefix "${version}")"
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ for env_path in "${version_dir_entries[@]}"; do
|
|||
if [[ -z $skip_aliases ]]; then
|
||||
print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}"
|
||||
fi
|
||||
# Mimics the test from pyenv-virtualenv-prefix
|
||||
# XXX: refactor itto a shared module ?
|
||||
elif [[ -f "${env_path}/bin/activate" ]]; then
|
||||
print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue