2011-08-02 23:11:41 +00:00
|
|
|
#!/usr/bin/env bash -e
|
2011-08-01 20:56:52 +00:00
|
|
|
|
2011-08-04 06:08:47 +00:00
|
|
|
RBENV_VERSION="$(rbenv-version)"
|
2011-08-01 20:50:26 +00:00
|
|
|
|
2011-08-03 04:19:37 +00:00
|
|
|
hit_prefix="* "
|
|
|
|
miss_prefix=" "
|
|
|
|
|
|
|
|
if [ "$1" = "--bare" ]; then
|
|
|
|
hit_prefix=""
|
|
|
|
miss_prefix=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
for path in "${HOME}/.rbenv/versions/"*; do
|
2011-08-01 20:50:26 +00:00
|
|
|
if [ -d "$path" ]; then
|
|
|
|
version="${path##*/}"
|
|
|
|
|
|
|
|
if [ "$version" == "$RBENV_VERSION" ]; then
|
2011-08-03 04:19:37 +00:00
|
|
|
echo "${hit_prefix}${version}"
|
2011-08-01 20:50:26 +00:00
|
|
|
else
|
2011-08-03 04:19:37 +00:00
|
|
|
echo "${miss_prefix}${version}"
|
2011-08-01 20:50:26 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|