From c02758e1f22ca701b114594e2ae0f5de6dff1d4b Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Thu, 6 Jan 2022 13:48:55 -0600 Subject: [PATCH] Print output when pushing to Heroku This is just a convenience enhancement - rather than swallowing all the output from the Heroku push command, print stdout and stderr like we do elsewhere with subprocesses. Heoku pushes are pretty involved and dump lots of useful output, so it should be useful for users to see this. --- plugins/pushes/heroku/push.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/pushes/heroku/push.rb b/plugins/pushes/heroku/push.rb index a0e26df8a..50ea45cd0 100644 --- a/plugins/pushes/heroku/push.rb +++ b/plugins/pushes/heroku/push.rb @@ -121,7 +121,14 @@ module VagrantPlugins # Execute the command, raising an exception if it fails. # @return [Vagrant::Util::Subprocess::Result] def execute!(*cmd) - result = Vagrant::Util::Subprocess.execute(*cmd) + subproccmd = cmd.dup << { notify: [:stdout, :stderr] } + result = Vagrant::Util::Subprocess.execute(*subproccmd) do |type, data| + if type == :stdout + @env.ui.info(data, new_line: false) + elsif type == :stderr + @env.ui.warn(data, new_line: false) + end + end if result.exit_code != 0 raise Errors::CommandFailed,