mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
8187bc84e3
users can use multiple python versions at once.
26 lines
644 B
Bash
Executable file
26 lines
644 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
PYENV_VERSION_FILE="$1"
|
|
shift
|
|
PYENV_VERSIONS=()
|
|
for version in "$@"; do
|
|
PYENV_VERSIONS=("${PYENV_VERSIONS[@]}" "$version")
|
|
done
|
|
|
|
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.
|
|
for PYENV_VERSION in "${PYENV_VERSIONS[@]}"; do
|
|
pyenv-prefix "$PYENV_VERSION" >/dev/null
|
|
done
|
|
|
|
# Write the version out to disk.
|
|
rm -f "$PYENV_VERSION_FILE"
|
|
for PYENV_VERSION in "${PYENV_VERSIONS[@]}"; do
|
|
echo "$PYENV_VERSION" >> "$PYENV_VERSION_FILE"
|
|
done
|