@@ -11,8 +11,11 @@ use owo_colors::{Style, Styled};
1111use vite_path:: AbsolutePath ;
1212
1313use super :: {
14- cache:: { format_cache_status_inline, format_cache_status_summary} ,
15- event:: { CacheStatus , ExecutionEvent , ExecutionEventKind , ExecutionId , ExecutionItemDisplay } ,
14+ cache:: { format_cache_status_inline, format_cache_status_summary, format_cache_update_status} ,
15+ event:: {
16+ CacheStatus , CacheUpdateStatus , ExecutionEvent , ExecutionEventKind , ExecutionId ,
17+ ExecutionItemDisplay ,
18+ } ,
1619} ;
1720
1821/// Wrap of `OwoColorize` that ignores style if `NO_COLOR` is set.
@@ -55,6 +58,7 @@ const CACHE_MISS_STYLE: Style = Style::new().purple();
5558struct ExecutionInfo {
5659 display : Option < ExecutionItemDisplay > ,
5760 cache_status : CacheStatus , // Non-optional, determined at Start
61+ cache_update_status : Option < CacheUpdateStatus > , // Set at Finish
5862 exit_status : Option < i32 > ,
5963 error_message : Option < String > ,
6064}
@@ -175,6 +179,7 @@ impl<W: Write> LabeledReporter<W> {
175179 self . executions . push ( ExecutionInfo {
176180 display : None ,
177181 cache_status,
182+ cache_update_status : None ,
178183 exit_status : None ,
179184 error_message : None ,
180185 } ) ;
@@ -217,6 +222,7 @@ impl<W: Write> LabeledReporter<W> {
217222 self . executions . push ( ExecutionInfo {
218223 display : Some ( display) ,
219224 cache_status,
225+ cache_update_status : None ,
220226 exit_status : None ,
221227 error_message : None ,
222228 } ) ;
@@ -244,17 +250,23 @@ impl<W: Write> LabeledReporter<W> {
244250 self . stats . failed += 1 ;
245251 }
246252
247- fn handle_finish ( & mut self , execution_id : ExecutionId , status : Option < i32 > ) {
253+ fn handle_finish (
254+ & mut self ,
255+ execution_id : ExecutionId ,
256+ status : Option < i32 > ,
257+ cache_update_status : CacheUpdateStatus ,
258+ ) {
248259 // Update failure statistics
249260 if let Some ( s) = status {
250261 if s != 0 {
251262 self . stats . failed += 1 ;
252263 }
253264 }
254265
255- // Update execution info exit status
266+ // Update execution info
256267 if let Some ( exec) = self . executions . last_mut ( ) {
257268 exec. exit_status = status;
269+ exec. cache_update_status = Some ( cache_update_status) ;
258270 }
259271
260272 // Add a line break after each task's output for better readability
@@ -433,6 +445,14 @@ impl<W: Write> LabeledReporter<W> {
433445 } ;
434446 let _ = writeln ! ( self . writer, " {}" , styled_summary) ;
435447
448+ // Cache update status (only shown for NonZeroExitStatus)
449+ if let Some ( ref cache_update_status) = exec. cache_update_status {
450+ if let Some ( update_msg) = format_cache_update_status ( cache_update_status) {
451+ let _ =
452+ writeln ! ( self . writer, " {}" , update_msg. style( Style :: new( ) . yellow( ) ) ) ;
453+ }
454+ }
455+
436456 // Error message if present
437457 if let Some ( ref error_msg) = exec. error_message {
438458 let _ = writeln ! (
@@ -489,8 +509,8 @@ impl<W: Write> Reporter for LabeledReporter<W> {
489509 ExecutionEventKind :: Error { message } => {
490510 self . handle_error ( event. execution_id , message) ;
491511 }
492- ExecutionEventKind :: Finish { status, cache_update_status : _ } => {
493- self . handle_finish ( event. execution_id , status) ;
512+ ExecutionEventKind :: Finish { status, cache_update_status } => {
513+ self . handle_finish ( event. execution_id , status, cache_update_status ) ;
494514 }
495515 }
496516 }
0 commit comments