@@ -531,23 +531,27 @@ fn log_command(
531
531
return future:: err ( Error :: from ( CommandError :: Timeout ( timeout. as_secs ( ) ) ) ) ;
532
532
}
533
533
534
+ actions. next_input ( & line) ;
535
+ if let Some ( f) = & mut process_lines {
536
+ f ( & line, & mut actions) ;
537
+ }
538
+ let lines = actions. take_lines ( ) ;
539
+
534
540
if log_output {
535
- info ! ( "[{}] {}" , kind. prefix( ) , line) ;
541
+ for line in & lines {
542
+ info ! ( "[{}] {:#?}" , kind. prefix( ) , line) ;
543
+ }
536
544
}
537
- future:: ok ( ( kind, line) )
545
+
546
+ future:: ok ( ( kind, lines) )
538
547
} )
539
548
. fold (
540
549
( Vec :: new ( ) , Vec :: new ( ) ) ,
541
- move |mut res, ( kind, line) | -> Result < _ , Error > {
542
- actions. next_input ( & line) ;
543
-
544
- if let Some ( f) = & mut process_lines {
545
- f ( & line, & mut actions) ;
546
- }
550
+ move |mut res, ( kind, mut lines) | -> Result < _ , Error > {
547
551
if capture {
548
552
match kind {
549
- OutputKind :: Stdout => res. 0 . append ( & mut actions . take_lines ( ) ) ,
550
- OutputKind :: Stderr => res. 1 . append ( & mut actions . take_lines ( ) ) ,
553
+ OutputKind :: Stdout => res. 0 . append ( & mut lines ) ,
554
+ OutputKind :: Stderr => res. 1 . append ( & mut lines ) ,
551
555
}
552
556
}
553
557
Ok ( res)
0 commit comments