1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-12 13:33:45 -05:00
Command `rbenv version-name > .ruby-version` will create an empty `.ruby-version` file
before running `rbenv-version-file`. This causes `rbenv-version-file` to return empty
string which in turn causes `rbenv-version-name` to return `system`.

Ensure size of `.ruby-version` is non-zero as a workaround.
This commit is contained in:
Victor Lim
2018-02-26 16:32:43 +08:00
parent b943955dbf
commit 9daf81f16e
3 changed files with 3 additions and 3 deletions

View File

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