Fix redir version fetching.

"" || "something" doesn't really work. Have to check for the actual string
length to determine if got something or not out of the pipe.
This commit is contained in:
Francisco Soto 2018-09-24 18:18:08 -07:00 committed by Virgil Dupras
parent 5a1f6ab2cb
commit 21725d3bb8

View file

@ -108,7 +108,7 @@ module Vagrant
def redir_version
stdout, stderr, _ = Open3.capture3 "redir --version"
# For some weird reason redir printed version information in STDERR prior to 3.2
version = stdout || stderr
version = stdout.empty? ? stderr : stdout
version.split('.')[0].to_i
end