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.
27 lines
587 B
Bash
Executable file
27 lines
587 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name))
|
|
|
|
if [ "$1" = "--bare" ]; then
|
|
hit_prefix=""
|
|
miss_prefix=""
|
|
print_version="$PYENV_VERSION_NAMES"
|
|
else
|
|
hit_prefix="* "
|
|
miss_prefix=" "
|
|
print_version="$PYENV_VERSION_NAMES (set by $(pyenv-version-origin))"
|
|
fi
|
|
|
|
for path in "${PYENV_ROOT}/versions/"*; do
|
|
if [ -d "$path" ]; then
|
|
version="${path##*/}"
|
|
|
|
if [ "$version" == "$PYENV_VERSION_NAMES" ]; then
|
|
echo "${hit_prefix}${print_version}"
|
|
else
|
|
echo "${miss_prefix}${version}"
|
|
fi
|
|
fi
|
|
done
|