mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-28 13:20:59 +00:00
8187bc84e3
users can use multiple python versions at once.
38 lines
687 B
Bash
Executable file
38 lines
687 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
# Provide pyenv completions
|
|
if [ "$1" = "--complete" ]; then
|
|
echo --unset
|
|
echo system
|
|
exec pyenv-versions --bare
|
|
fi
|
|
|
|
versions=()
|
|
for version in "$@"; do
|
|
versions=("${versions[@]}" "$version")
|
|
done
|
|
|
|
if [ -z "$versions" ]; then
|
|
if [ -z "$PYENV_VERSIONS" ]; then
|
|
echo "pyenv: no shell-specific version configured" >&2
|
|
exit 1
|
|
else
|
|
echo "echo \"\$PYENV_VERSIONS\""
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
if [ "$versions" = "--unset" ]; then
|
|
echo "unset PYENV_VERSIONS"
|
|
exit 1
|
|
fi
|
|
|
|
# Make sure the specified version is installed.
|
|
pyenv-prefix $versions >/dev/null
|
|
|
|
{
|
|
IFS=:
|
|
echo "export PYENV_VERSIONS=\"${versions[*]}\""
|
|
}
|