pyenv/libexec/rbenv-versions
Alexander Rinass 5130f0464a Support install locations other than $HOME/.rbenv.
Define RBENV_HOME env variable in libexec/rbenv and let all script delegates use this variable to determine rbenv's install location.
2011-08-25 09:28:01 +02:00

26 lines
509 B
Bash
Executable file

#!/usr/bin/env bash
set -e
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_HOME}/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