2011-08-12 05:33:45 -04:00
|
|
|
#!/usr/bin/env bash
|
2012-12-29 17:34:53 -05:00
|
|
|
# Summary: Show the current Ruby version and its origin
|
|
|
|
#
|
2012-12-29 23:05:04 -05:00
|
|
|
# Shows the currently selected Ruby version and how it was
|
|
|
|
# selected. To obtain only the version string, use `rbenv
|
|
|
|
# version-name'.
|
2012-12-29 13:06:20 -05:00
|
|
|
|
2011-08-12 05:33:45 -04:00
|
|
|
set -e
|
2011-09-12 11:11:59 -04:00
|
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
2011-08-01 16:50:26 -04:00
|
|
|
|
2020-01-08 02:54:33 -05:00
|
|
|
RBENV_VERSION_FILE="$(rbenv-version-origin)"
|
|
|
|
if [ -e "$RBENV_VERSION_FILE" ]; then
|
|
|
|
echo "$(rbenv-version-name) (set by $RBENV_VERSION_FILE)"
|
|
|
|
else
|
|
|
|
echo "$(rbenv-version-name)"
|
|
|
|
fi
|