mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-23 01:10:50 +00:00
27 lines
541 B
Bash
Executable file
27 lines
541 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
|
|
|
RBENV_VERSION_NAME="$(rbenv-version-name)"
|
|
|
|
if [ "$1" = "--bare" ]; then
|
|
hit_prefix=""
|
|
miss_prefix=""
|
|
print_version="$RBENV_VERSION_NAME"
|
|
else
|
|
hit_prefix="* "
|
|
miss_prefix=" "
|
|
print_version="$(rbenv-version)"
|
|
fi
|
|
|
|
for path in "${RBENV_ROOT}/versions/"*; do
|
|
if [ -d "$path" ]; then
|
|
version="${path##*/}"
|
|
|
|
if [ "$version" == "$RBENV_VERSION_NAME" ]; then
|
|
echo "${hit_prefix}${print_version}"
|
|
else
|
|
echo "${miss_prefix}${version}"
|
|
fi
|
|
fi
|
|
done
|