mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
26 lines
597 B
Bash
Executable file
26 lines
597 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
# Provide pyenv completions
|
|
if [ "$1" = "--complete" ]; then
|
|
echo system
|
|
exec pyenv-versions --bare
|
|
fi
|
|
|
|
versions=($@)
|
|
PYENV_VERSION_FILE="${PYENV_ROOT}/version"
|
|
|
|
if [ -n "$versions" ]; then
|
|
pyenv-version-file-write "$PYENV_VERSION_FILE" "${versions[@]}"
|
|
else
|
|
IFS=: versions=($(
|
|
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
|
pyenv-version-file-read "${PYENV_ROOT}/global" ||
|
|
pyenv-version-file-read "${PYENV_ROOT}/default" ||
|
|
echo system
|
|
))
|
|
for version in "${versions[@]}"; do
|
|
echo "$version"
|
|
done
|
|
fi
|