瀏覽代碼

Fix discovering `.ruby-version` files in root directory

It's not that this is a preferred way to set a global version (one
should use `rbenv global <version>` instead), but this fixes the
function purely for correctness: all parent directories should be
scanned, even the root directory.

Fixes #745
pull/487/head^2
Mislav Marohnić 11 年之前
父節點
當前提交
43b28caa94
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      libexec/rbenv-version-file

+ 2
- 1
libexec/rbenv-version-file 查看文件

@ -5,7 +5,7 @@ set -e
find_local_version_file() {
local root="$1"
while [ -n "$root" ]; do
while true; do
if [ -e "${root}/.ruby-version" ]; then
echo "${root}/.ruby-version"
exit
@ -13,6 +13,7 @@ find_local_version_file() {
echo "${root}/.rbenv-version"
exit
fi
[ -n "$root" ] || break
root="${root%/*}"
done
}

Loading…
取消
儲存