1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

add pyenv push and pyenv pop to manage version stack

This commit is contained in:
Yamashita Yuu
2012-10-03 12:19:42 +09:00
parent aede700619
commit e8ad78f837
3 changed files with 60 additions and 0 deletions

18
libexec/pyenv-sh-pop Executable file
View File

@@ -0,0 +1,18 @@
#!/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