pyenv/libexec/rbenv-version-file

25 lines
516 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x
root="$RBENV_DIR"
while [ -n "$root" ]; do
if [ -e "${root}/.rbenv-version" ]; then
echo "${root}/.rbenv-version"
exit
fi
root="${root%/*}"
done
global_version_file="${RBENV_ROOT}/version"
2011-08-18 15:32:33 -04:00
if [ -e "$global_version_file" ]; then
echo "$global_version_file"
elif [ -e "${RBENV_ROOT}/global" ]; then
echo "${RBENV_ROOT}/global"
elif [ -e "${RBENV_ROOT}/default" ]; then
echo "${RBENV_ROOT}/default"
2011-08-18 15:32:33 -04:00
else
echo "$global_version_file"
2011-08-18 15:32:33 -04:00
fi