@@ -73,6 +73,7 @@ pub struct BootstrapCommand {
73
73
args : Vec < OsString > ,
74
74
envs : Vec < ( OsString , OsString ) > ,
75
75
cwd : Option < PathBuf > ,
76
+ should_cache : bool ,
76
77
77
78
command : Command ,
78
79
pub failure_behavior : BehaviorOnFailure ,
@@ -86,15 +87,18 @@ pub struct BootstrapCommand {
86
87
impl < ' a > BootstrapCommand {
87
88
#[ track_caller]
88
89
pub fn new < S : AsRef < OsStr > > ( program : S ) -> Self {
89
- Command :: new ( program) . into ( )
90
+ Self { should_cache : true , .. Command :: new ( program) . into ( ) }
90
91
}
91
-
92
92
pub fn arg < S : AsRef < OsStr > > ( & mut self , arg : S ) -> & mut Self {
93
93
self . args . push ( arg. as_ref ( ) . to_os_string ( ) ) ;
94
94
self . command . arg ( arg. as_ref ( ) ) ;
95
95
self
96
96
}
97
97
98
+ pub fn should_cache ( & self ) -> bool {
99
+ self . should_cache
100
+ }
101
+
98
102
pub fn args < I , S > ( & mut self , args : I ) -> & mut Self
99
103
where
100
104
I : IntoIterator < Item = S > ,
@@ -197,6 +201,7 @@ impl<'a> BootstrapCommand {
197
201
// We don't know what will happen with the returned command, so we need to mark this
198
202
// command as executed proactively.
199
203
self . mark_as_executed ( ) ;
204
+ self . should_cache = false ;
200
205
& mut self . command
201
206
}
202
207
@@ -250,6 +255,7 @@ impl From<Command> for BootstrapCommand {
250
255
args : Vec :: new ( ) ,
251
256
envs : Vec :: new ( ) ,
252
257
cwd : None ,
258
+ should_cache : false ,
253
259
command,
254
260
failure_behavior : BehaviorOnFailure :: Exit ,
255
261
run_always : false ,
0 commit comments