Просмотр исходного кода

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 лет назад
Родитель
Сommit
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() { find_local_version_file() {
local root="$1" local root="$1"
while [ -n "$root" ]; do
while true; do
if [ -e "${root}/.ruby-version" ]; then if [ -e "${root}/.ruby-version" ]; then
echo "${root}/.ruby-version" echo "${root}/.ruby-version"
exit exit
@ -13,6 +13,7 @@ find_local_version_file() {
echo "${root}/.rbenv-version" echo "${root}/.rbenv-version"
exit exit
fi fi
[ -n "$root" ] || break
root="${root%/*}" root="${root%/*}"
done done
} }

Загрузка…
Отмена
Сохранить