rbenv-version-file: ensure that the version file is a file

Forwarded from https://github.com/pyenv/pyenv/pull/606.
This commit is contained in:
Daniel Hahler 2017-06-05 15:40:59 +02:00
parent 755c820724
commit 95b1b05cbe

View file

@ -9,7 +9,7 @@ target_dir="$1"
find_local_version_file() {
local root="$1"
while ! [[ "$root" =~ ^//[^/]*$ ]]; do
if [ -e "${root}/.ruby-version" ]; then
if [ -f "${root}/.ruby-version" ]; then
echo "${root}/.ruby-version"
return 0
fi