1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-13 22:03:52 -05:00

search commands from python version stack.

users can use multiple python versions at once.
This commit is contained in:
Yamashita Yuu
2012-08-31 16:09:46 +09:00
parent 880ea61dd8
commit 8187bc84e3
11 changed files with 113 additions and 78 deletions

View File

@@ -3,15 +3,24 @@ set -e
[ -n "$PYENV_DEBUG" ] && set -x
PYENV_VERSION_FILE="$1"
PYENV_VERSION="$2"
shift
PYENV_VERSIONS=()
for version in "$@"; do
PYENV_VERSIONS=("${PYENV_VERSIONS[@]}" "$version")
done
if [ -z "$PYENV_VERSION" ] || [ -z "$PYENV_VERSION_FILE" ]; then
echo "usage: pyenv write-version-file FILENAME VERSION" >&2
if [ -z "$PYENV_VERSIONS" ] || [ -z "$PYENV_VERSION_FILE" ]; then
echo "usage: pyenv write-version-file FILENAME VERSIONS..." >&2
exit 1
fi
# Make sure the specified version is installed.
pyenv-prefix "$PYENV_VERSION" >/dev/null
for PYENV_VERSION in "${PYENV_VERSIONS[@]}"; do
pyenv-prefix "$PYENV_VERSION" >/dev/null
done
# Write the version out to disk.
echo "$PYENV_VERSION" > "$PYENV_VERSION_FILE"
rm -f "$PYENV_VERSION_FILE"
for PYENV_VERSION in "${PYENV_VERSIONS[@]}"; do
echo "$PYENV_VERSION" >> "$PYENV_VERSION_FILE"
done