Skip to content

Commit

Permalink
Merge pull request #1069 from viclim/fix-issue-1065
Browse files Browse the repository at this point in the history
Ignore empty `.ruby-version` files
  • Loading branch information
mislav committed Feb 26, 2018
2 parents b943955 + 9daf81f commit c8ba27f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libexec/rbenv-version-file
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/version-file.bats
Expand Up @@ -9,7 +9,7 @@ setup() {

create_file() {
mkdir -p "$(dirname "$1")"
touch "$1"
echo "system" > "$1"
}

@test "detects global 'version' file" {
Expand Down
2 changes: 1 addition & 1 deletion test/version-origin.bats
Expand Up @@ -26,7 +26,7 @@ setup() {
}

@test "detects local file" {
touch .ruby-version
echo "system" > .ruby-version
run rbenv-version-origin
assert_success "${PWD}/.ruby-version"
}
Expand Down

0 comments on commit c8ba27f

Please sign in to comment.