File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ impl ExecutionContext {
148
148
) -> CommandOutput {
149
149
let cache_key = command. cache_key ( ) ;
150
150
151
- if let Some ( cached_output) = self . command_cache . get ( & cache_key) {
151
+ if command. should_cache ( )
152
+ && let Some ( cached_output) = self . command_cache . get ( & cache_key) {
152
153
command. mark_as_executed ( ) ;
153
154
if self . dry_run ( ) && !command. run_always {
154
155
return CommandOutput :: default ( ) ;
@@ -159,7 +160,7 @@ impl ExecutionContext {
159
160
160
161
let output = self . start ( command, stdout, stderr) . wait_for_output ( self ) ;
161
162
162
- if !self . dry_run ( ) || command. run_always {
163
+ if !self . dry_run ( ) || command. run_always && command . should_cache ( ) {
163
164
self . command_cache . insert ( cache_key, output. clone ( ) ) ;
164
165
}
165
166
You can’t perform that action at this time.
0 commit comments