From cf784d5d3cdc2c1a49b15fc4dc5a0fcc76a40664 Mon Sep 17 00:00:00 2001 From: Chad Maloney Date: Tue, 25 Nov 2014 14:37:59 -0600 Subject: [PATCH] GH-4201: Split process output by line so prefix shows on each line. Also fixed localization reference. --- plugins/synced_folders/rsync/helper.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/synced_folders/rsync/helper.rb b/plugins/synced_folders/rsync/helper.rb index 21d0890ad..eb637af96 100644 --- a/plugins/synced_folders/rsync/helper.rb +++ b/plugins/synced_folders/rsync/helper.rb @@ -31,6 +31,10 @@ module VagrantPlugins Regexp.new(regexp) end + # Output rsync process stdout/stderr line by line + def self.outputRsyncData(io_name, data) + end + def self.rsync_single(machine, ssh_info, opts) # Folder info guestpath = opts[:guestpath] @@ -122,7 +126,7 @@ module VagrantPlugins "vagrant.rsync_folder_excludes", excludes: excludes.inspect)) end if opts.include?(:showoutput) - machine.ui.info(I18n.t("vagrant.rsync_showingoutput")); + machine.ui.info(I18n.t("vagrant.rsync_showing_output")); end # If we have tasks to do before rsyncing, do those. @@ -132,8 +136,9 @@ module VagrantPlugins if opts.include?(:showoutput) command_opts[:notify] = [ :stdout, :stderr ]; - r = Vagrant::Util::Subprocess.execute( - *(command + [command_opts])) { |io_name,data| machine.ui.info("rsync[#{io_name}] -> #{data}") } + r = Vagrant::Util::Subprocess.execute(*(command + [command_opts])) { + |io_name,data| data.each_line { |line| machine.ui.info("rsync[#{io_name}] -> #{line}") } + } else r = Vagrant::Util::Subprocess.execute(*(command + [command_opts])) end