mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
fixed pyenv shell
. we cannot carry out bash array via envvars.
This commit is contained in:
parent
dff57ae35d
commit
da659739d2
2 changed files with 8 additions and 13 deletions
|
@ -9,30 +9,24 @@ if [ "$1" = "--complete" ]; then
|
||||||
exec pyenv-versions --bare
|
exec pyenv-versions --bare
|
||||||
fi
|
fi
|
||||||
|
|
||||||
versions=()
|
version="$1"
|
||||||
for version in "$@"; do
|
|
||||||
versions=("${versions[@]}" "$version")
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$versions" ]; then
|
if [ -z "$version" ]; then
|
||||||
if [ -z "$PYENV_VERSION" ]; then
|
if [ -z "$PYENV_VERSION" ]; then
|
||||||
echo "pyenv: no shell-specific version configured" >&2
|
echo "pyenv: no shell-specific version configured" >&2
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "echo \"\${PYENV_VERSION[@]}\""
|
echo "echo \"\$PYENV_VERSION\""
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$versions" = "--unset" ]; then
|
if [ "$version" = "--unset" ]; then
|
||||||
echo "unset PYENV_VERSION"
|
echo "unset PYENV_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the specified version is installed.
|
# Make sure the specified version is installed.
|
||||||
pyenv-prefix $versions >/dev/null
|
pyenv-prefix $version >/dev/null
|
||||||
|
|
||||||
{
|
echo "export PYENV_VERSION=\"${version}\""
|
||||||
IFS=:
|
|
||||||
echo "export PYENV_VERSION=(\"${versions[@]}\")"
|
|
||||||
}
|
|
||||||
|
|
|
@ -40,7 +40,8 @@ remove_from_path() {
|
||||||
echo "${result%:}"
|
echo "${result%:}"
|
||||||
}
|
}
|
||||||
|
|
||||||
IFS=: PYENV_VERSION=($(pyenv-version-name))
|
IFS=: versions=($(pyenv-version-name))
|
||||||
|
PYENV_VERSION=("${versions[@]}")
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
|
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
|
|
Loading…
Reference in a new issue