mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
8187bc84e3
users can use multiple python versions at once.
24 lines
600 B
Bash
Executable file
24 lines
600 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
if [ -z "$PYENV_VERSIONS" ]; then
|
|
PYENV_VERSION_FILE="$(pyenv-version-file)"
|
|
IFS=: PYENV_VERSIONS=($(pyenv-version-file-read "$PYENV_VERSION_FILE" || true))
|
|
fi
|
|
|
|
if [ -z "$PYENV_VERSIONS" ] || [ "$PYENV_VERSIONS" = "system" ] ; then
|
|
echo "system"
|
|
exit
|
|
fi
|
|
|
|
for PYENV_VERSION in "${PYENV_VERSIONS[@]}"; do
|
|
PYENV_VERSION_PATH="${PYENV_ROOT}/versions/${PYENV_VERSION}"
|
|
|
|
if [ ! -d "$PYENV_VERSION_PATH" ]; then
|
|
echo "pyenv: version \`$PYENV_VERSION' is not installed" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
IFS=: echo "${PYENV_VERSIONS[*]}"
|