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 @@ -68,6 +68,10 @@ impl DownloadTracker {
6868 self . retrying_download ( url) ;
6969 true
7070 }
71+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
72+ self . installing_component ( component) ;
73+ true
74+ }
7175 _ => false ,
7276 }
7377 }
@@ -146,4 +150,24 @@ impl DownloadTracker {
146150 * retry_time = Some ( Instant :: now ( ) ) ;
147151 pb. set_style ( ProgressStyle :: with_template ( "{msg:>12.bold} retrying download" ) . unwrap ( ) ) ;
148152 }
153+
154+ /// Notifies that the downloaded component is being installed.
155+ pub ( crate ) fn installing_component ( & mut self , component : & str ) {
156+ let key = self
157+ . file_progress_bars
158+ . keys ( )
159+ . find ( |comp| comp. contains ( component) )
160+ . cloned ( ) ;
161+ if let Some ( key) = key
162+ && let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
163+ {
164+ pb. set_style (
165+ ProgressStyle :: with_template (
166+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now..." ,
167+ )
168+ . unwrap ( ) ,
169+ ) ;
170+ pb. finish ( ) ;
171+ }
172+ }
149173}
You can’t perform that action at this time.
0 commit comments