mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-03 18:23:58 -05:00
3bfd91de51
than compatibility plugin.
21 lines
634 B
Bash
Executable file
21 lines
634 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Usage: pyenv pop <version>
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
IFS=: versions=($(pyenv-version-name))
|
|
|
|
echo "WARNING: The \`pop' command will be removed from pyenv. Please install https://github.com/yyuu/pyenv-version-ext." 1>&2
|
|
|
|
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
|