mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 23:20:47 +00:00
6938692ca2
/usr/bin/env seems to have problems with arguments to bash on some platforms. To bypass this, use set -e instead.
26 lines
510 B
Bash
Executable file
26 lines
510 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 "${HOME}/.rbenv/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
|