|
2 | 2 | //!
|
3 | 3 | //! This module provides a structured way to execute and manage commands efficiently,
|
4 | 4 | //! ensuring controlled failure handling and output management.
|
5 |
| -#![allow(warnings)] |
6 | 5 | use std::ffi::OsStr;
|
7 | 6 | use std::fmt::{Debug, Formatter};
|
8 | 7 | use std::path::Path;
|
9 |
| -use std::process::{Child, Command, CommandArgs, CommandEnvs, ExitStatus, Output, Stdio}; |
| 8 | +use std::process::{Command, CommandArgs, CommandEnvs, ExitStatus, Output, Stdio}; |
10 | 9 |
|
11 | 10 | use build_helper::ci::CiEnv;
|
12 | 11 | use build_helper::drop_bomb::DropBomb;
|
@@ -73,7 +72,7 @@ pub struct BootstrapCommand {
|
73 | 72 | drop_bomb: DropBomb,
|
74 | 73 | }
|
75 | 74 |
|
76 |
| -impl BootstrapCommand { |
| 75 | +impl<'a> BootstrapCommand { |
77 | 76 | #[track_caller]
|
78 | 77 | pub fn new<S: AsRef<OsStr>>(program: S) -> Self {
|
79 | 78 | Command::new(program).into()
|
@@ -160,16 +159,19 @@ impl BootstrapCommand {
|
160 | 159 |
|
161 | 160 | /// Spawn the command in background, while capturing and returning all its output.
|
162 | 161 | #[track_caller]
|
163 |
| - pub fn start_capture(&mut self, exec_ctx: impl AsRef<ExecutionContext>) -> DeferredCommand { |
| 162 | + pub fn start_capture( |
| 163 | + &'a mut self, |
| 164 | + exec_ctx: impl AsRef<ExecutionContext>, |
| 165 | + ) -> DeferredCommand<'a> { |
164 | 166 | exec_ctx.as_ref().start(self, OutputMode::Capture, OutputMode::Capture)
|
165 | 167 | }
|
166 | 168 |
|
167 | 169 | /// Spawn the command in background, while capturing and returning stdout, and printing stderr.
|
168 | 170 | #[track_caller]
|
169 | 171 | pub fn start_capture_stdout(
|
170 |
| - &mut self, |
| 172 | + &'a mut self, |
171 | 173 | exec_ctx: impl AsRef<ExecutionContext>,
|
172 |
| - ) -> DeferredCommand { |
| 174 | + ) -> DeferredCommand<'a> { |
173 | 175 | exec_ctx.as_ref().start(self, OutputMode::Capture, OutputMode::Print)
|
174 | 176 | }
|
175 | 177 |
|
|
0 commit comments