mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
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
This commit is contained in:
parent
5b9e4f0584
commit
43b28caa94
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue