@@ -81,6 +81,7 @@ pub struct BootstrapCommand {
81
81
args : Vec < OsString > ,
82
82
envs : Vec < ( OsString , OsString ) > ,
83
83
cwd : Option < PathBuf > ,
84
+ should_cache : bool ,
84
85
85
86
command : Command ,
86
87
pub failure_behavior : BehaviorOnFailure ,
@@ -94,15 +95,18 @@ pub struct BootstrapCommand {
94
95
impl < ' a > BootstrapCommand {
95
96
#[ track_caller]
96
97
pub fn new < S : AsRef < OsStr > > ( program : S ) -> Self {
97
- Command :: new ( program) . into ( )
98
+ Self { should_cache : true , .. Command :: new ( program) . into ( ) }
98
99
}
99
-
100
100
pub fn arg < S : AsRef < OsStr > > ( & mut self , arg : S ) -> & mut Self {
101
101
self . args . push ( arg. as_ref ( ) . to_os_string ( ) ) ;
102
102
self . command . arg ( arg. as_ref ( ) ) ;
103
103
self
104
104
}
105
105
106
+ pub fn should_cache ( & self ) -> bool {
107
+ self . should_cache
108
+ }
109
+
106
110
pub fn args < I , S > ( & mut self , args : I ) -> & mut Self
107
111
where
108
112
I : IntoIterator < Item = S > ,
@@ -205,6 +209,7 @@ impl<'a> BootstrapCommand {
205
209
// We don't know what will happen with the returned command, so we need to mark this
206
210
// command as executed proactively.
207
211
self . mark_as_executed ( ) ;
212
+ self . should_cache = false ;
208
213
& mut self . command
209
214
}
210
215
@@ -258,6 +263,7 @@ impl From<Command> for BootstrapCommand {
258
263
args : Vec :: new ( ) ,
259
264
envs : Vec :: new ( ) ,
260
265
cwd : None ,
266
+ should_cache : false ,
261
267
command,
262
268
failure_behavior : BehaviorOnFailure :: Exit ,
263
269
run_always : false ,
0 commit comments