def execute_stream(*command, label: nil, pwd: nil)
      opts = {}
      opts[:chdir] = pwd unless pwd.nil?
      
      Open3.popen2e(command.join(' '), opts) do |stdin, stdout_and_stderr, wait_thr|
        stdin.close
        
        until stdout_and_stderr.closed? || stdout_and_stderr.eof?
          line = stdout_and_stderr.gets
          log_info line.chomp
          $stdout.flush
        end
        
        unless wait_thr.value.success?  
          raise SubprocessError.new(label, command.join(' '), wait_thr.value)
        end
        stdout_and_stderr.close
      end
      
      true
    end
def execute_stream(*command, label: nil, pwd: nil)
      opts = {}
      opts[:chdir] = pwd unless pwd.nil?
      
      Open3.popen2e(command.join(' '), opts) do |stdin, stdout_and_stderr, wait_thr|
        stdin.close
        
        until stdout_and_stderr.closed? || stdout_and_stderr.eof?
          line = stdout_and_stderr.gets
          log_info line.chomp
          $stdout.flush
        end
        
        unless wait_thr.value.success?  
          raise SubprocessError.new(label, command.join(' '), wait_thr.value)
        end
        stdout_and_stderr.close
      end
      
      true
    end
Synchronously execute a command as a subprocess and and stream the output
 to `STDOUT`

 @param [Array<String>] command The command line
 @param [String] label A label for debug and logging purposes
 @param [String] pwd Optionally specify a different working directory in which to execute the command

 @return [TrueClass] `true` if the command executed successfully
 @raise [SubprocessError] if the subprocess returns status > 0