@@ -211,6 +211,15 @@ impl<'a> BootstrapCommand {
211
211
exec_ctx. as_ref ( ) . start ( self , OutputMode :: Capture , OutputMode :: Print )
212
212
}
213
213
214
+ /// Spawn the command in background, while capturing and returns a handle to stream the output.
215
+ #[ track_caller]
216
+ pub fn stream_capture (
217
+ & ' a mut self ,
218
+ exec_ctx : impl AsRef < ExecutionContext > ,
219
+ ) -> Option < StreamingCommand > {
220
+ exec_ctx. as_ref ( ) . stream ( self , OutputMode :: Capture , OutputMode :: Capture )
221
+ }
222
+
214
223
/// Spawn the command in background, while capturing and returning stdout, and printing stderr.
215
224
#[ track_caller]
216
225
pub fn stream_capture_stdout (
@@ -222,7 +231,7 @@ impl<'a> BootstrapCommand {
222
231
223
232
/// Mark the command as being executed, disarming the drop bomb.
224
233
/// If this method is not called before the command is dropped, its drop will panic.
225
- fn mark_as_executed ( & mut self ) {
234
+ pub fn mark_as_executed ( & mut self ) {
226
235
self . drop_bomb . defuse ( ) ;
227
236
}
228
237
@@ -624,18 +633,12 @@ impl ExecutionContext {
624
633
exit ! ( 1 ) ;
625
634
}
626
635
627
- <<<<<<< HEAD
628
- pub fn stream< ' a > (
629
- =======
630
636
/// Spawns the command with configured stdout and stderr handling.
631
637
///
632
- /// Returns `None` if in dry-run mode and the command is not allowed to run.
633
- ///
634
- /// Panics if the command fails to spawn.
638
+ /// Returns None if in dry-run mode or Panics if the command fails to spawn.
635
639
pub fn stream (
636
- >>>>>>> c2e83361cec ( add comment to exec)
637
640
& self ,
638
- command : & ' a mut BootstrapCommand ,
641
+ command : & mut BootstrapCommand ,
639
642
stdout : OutputMode ,
640
643
stderr : OutputMode ,
641
644
) -> Option < StreamingCommand > {
@@ -654,7 +657,7 @@ impl ExecutionContext {
654
657
655
658
let stdout = child. stdout . take ( ) ;
656
659
let stderr = child. stderr . take ( ) ;
657
- Some ( StreamingCommand { child, stdout, stderr } )
660
+ return Some ( StreamingCommand { child, stdout, stderr } ) ;
658
661
}
659
662
}
660
663
0 commit comments