mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-23 05:22:36 +00:00
2457419b4a
modified rbenv source for Python and renamed to pyenv.
27 lines
541 B
Bash
Executable file
27 lines
541 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
PYENV_VERSION_NAME="$(pyenv-version-name)"
|
|
|
|
if [ "$1" = "--bare" ]; then
|
|
hit_prefix=""
|
|
miss_prefix=""
|
|
print_version="$PYENV_VERSION_NAME"
|
|
else
|
|
hit_prefix="* "
|
|
miss_prefix=" "
|
|
print_version="$(pyenv-version)"
|
|
fi
|
|
|
|
for path in "${PYENV_ROOT}/versions/"*; do
|
|
if [ -d "$path" ]; then
|
|
version="${path##*/}"
|
|
|
|
if [ "$version" == "$PYENV_VERSION_NAME" ]; then
|
|
echo "${hit_prefix}${print_version}"
|
|
else
|
|
echo "${miss_prefix}${version}"
|
|
fi
|
|
fi
|
|
done
|