lib/vagrant-hosts/cap/facts/windows.rb in vagrant-hosts-2.8.2 vs lib/vagrant-hosts/cap/facts/windows.rb in vagrant-hosts-2.8.3

- old
+ new

@@ -37,6 +37,24 @@ end default.split[-2].chomp end + private + + # FIXME: de-duplicate with posix implementation after figuring out what + # happens to newlines. + def sudo(cmd) + stdout = '' + stderr = '' + + retval = machine.communicate.sudo(cmd) do |type, data| + if type == :stderr + stderr << data + else + stdout << data + end + end + + {:stdout => stdout, :stderr => stderr, :retval => retval} + end end