pyenv/libexec/pyenv-sh-pop

18 lines
478 B
Bash
Executable file

#!/usr/bin/env bash
set -e
[ -n "$PYENV_DEBUG" ] && set -x
IFS=: versions=($(pyenv-version-name))
length="${#versions[@]}"
PYENV_VERSION_NAMES=()
for ((i=0; i<length-1; i++)); do
PYENV_VERSION_NAMES=("${PYENV_VERSION_NAMES[@]}" "${versions[$i]}")
done
if [ -n "$PYENV_VERSION" ]; then
IFS=: PYENV_VERSION="${PYENV_VERSION_NAMES[*]}"
echo "export PYENV_VERSION=\"${PYENV_VERSION}\""
else
pyenv-version-file-write "$(pyenv-version-file)" "${PYENV_VERSION_NAMES[@]}"
fi