Skip to content

Commit c6c67ee

Browse files
committed
add cache cmd flag in execution context
1 parent a18dc47 commit c6c67ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap/src/utils/execution_context.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ impl ExecutionContext {
156156
) -> CommandOutput {
157157
let cache_key = command.compute_cache_hash();
158158

159-
if let Some(cached_output) = self.command_cache.get(cache_key) {
159+
if self.cache_cmd()
160+
&& let Some(cached_output) = self.command_cache.get(cache_key)
161+
{
160162
command.mark_as_executed();
161163
if self.dry_run() && !command.run_always {
162164
return CommandOutput::default();
@@ -167,7 +169,7 @@ impl ExecutionContext {
167169

168170
let output = self.start(command, stdout, stderr).wait_for_output(self);
169171

170-
if !self.dry_run() || command.run_always {
172+
if (!self.dry_run() || command.run_always) && self.cache_cmd() {
171173
self.command_cache.insert(cache_key, output.clone());
172174
}
173175

0 commit comments

Comments
 (0)