File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ impl DownloadTracker {
7373 self . retrying_download ( url) ;
7474 true
7575 }
76+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
77+ self . installing_component ( component) ;
78+ true
79+ }
7680 _ => false ,
7781 }
7882 }
@@ -151,4 +155,24 @@ impl DownloadTracker {
151155 * retry_time = Some ( Instant :: now ( ) ) ;
152156 pb. set_style ( ProgressStyle :: with_template ( "{msg:>12.bold} retrying download" ) . unwrap ( ) ) ;
153157 }
158+
159+ /// Notifies that the downloaded component is being installed.
160+ pub ( crate ) fn installing_component ( & mut self , component : & str ) {
161+ let key = self
162+ . file_progress_bars
163+ . keys ( )
164+ . find ( |comp| comp. contains ( component) )
165+ . cloned ( ) ;
166+ if let Some ( key) = key
167+ && let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
168+ {
169+ pb. set_style (
170+ ProgressStyle :: with_template (
171+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now..." ,
172+ )
173+ . unwrap ( ) ,
174+ ) ;
175+ pb. finish ( ) ;
176+ }
177+ }
154178}
You can’t perform that action at this time.
0 commit comments