mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-01 15:28:46 -05:00
ee3c9bef5e
also this will fix https://github.com/yyuu/python-virtualenv/issues/1
23 lines
511 B
Bash
Executable file
23 lines
511 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Usage: pyenv version-file-write <file> <version>
|
|
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
PYENV_VERSION_FILE="$1"
|
|
shift
|
|
versions=("$@")
|
|
|
|
if [ -z "$versions" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
|
pyenv-help --usage version-file-write >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Make sure the specified version is installed.
|
|
pyenv-prefix "${versions[@]}" >/dev/null
|
|
|
|
# Write the version out to disk.
|
|
rm -f "$PYENV_VERSION_FILE"
|
|
for version in "${versions[@]}"; do
|
|
echo "$version" >> "$PYENV_VERSION_FILE"
|
|
done
|