Explorar el Código

fixed `pyenv shell`. we cannot carry out bash array via envvars.

pull/1/head
Yamashita Yuu hace 12 años
padre
commit
da659739d2
Se han modificado 2 ficheros con 8 adiciones y 13 borrados
  1. +6
    -12
      libexec/pyenv-sh-shell
  2. +2
    -1
      libexec/pyenv-which

+ 6
- 12
libexec/pyenv-sh-shell Ver fichero

@ -9,30 +9,24 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare
fi
versions=()
for version in "$@"; do
versions=("${versions[@]}" "$version")
done
version="$1"
if [ -z "$versions" ]; then
if [ -z "$version" ]; then
if [ -z "$PYENV_VERSION" ]; then
echo "pyenv: no shell-specific version configured" >&2
exit 1
else
echo "echo \"\${PYENV_VERSION[@]}\""
echo "echo \"\$PYENV_VERSION\""
exit
fi
fi
if [ "$versions" = "--unset" ]; then
if [ "$version" = "--unset" ]; then
echo "unset PYENV_VERSION"
exit 1
fi
# Make sure the specified version is installed.
pyenv-prefix $versions >/dev/null
pyenv-prefix $version >/dev/null
{
IFS=:
echo "export PYENV_VERSION=(\"${versions[@]}\")"
}
echo "export PYENV_VERSION=\"${version}\""

+ 2
- 1
libexec/pyenv-which Ver fichero

@ -40,7 +40,8 @@ remove_from_path() {
echo "${result%:}"
}
IFS=: PYENV_VERSION=($(pyenv-version-name))
IFS=: versions=($(pyenv-version-name))
PYENV_VERSION=("${versions[@]}")
PYENV_COMMAND="$1"
if [ -z "$PYENV_COMMAND" ]; then

Cargando…
Cancelar
Guardar