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 {
148148 ) -> CommandOutput {
149149 let cache_key = command. cache_key ( ) ;
150150
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) {
152153 command. mark_as_executed ( ) ;
153154 if self . dry_run ( ) && !command. run_always {
154155 return CommandOutput :: default ( ) ;
@@ -159,7 +160,7 @@ impl ExecutionContext {
159160
160161 let output = self . start ( command, stdout, stderr) . wait_for_output ( self ) ;
161162
162- if !self . dry_run ( ) || command. run_always {
163+ if !self . dry_run ( ) || command. run_always && command . should_cache ( ) {
163164 self . command_cache . insert ( cache_key, output. clone ( ) ) ;
164165 }
165166
You can’t perform that action at this time.
0 commit comments