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 @@ -59,6 +59,10 @@ impl DownloadTracker {
5959 self . create_progress_bar ( component. to_owned ( ) , url. to_owned ( ) ) ;
6060 true
6161 }
62+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
63+ self . installing_component ( component) ;
64+ true
65+ }
6266 _ => false ,
6367 }
6468 }
@@ -104,4 +108,24 @@ impl DownloadTracker {
104108 ) ;
105109 pb. finish ( ) ;
106110 }
111+
112+ /// Notifies that the downloaded component is being installed.
113+ pub ( crate ) fn installing_component ( & mut self , component : & str ) {
114+ let key = self
115+ . file_progress_bars
116+ . keys ( )
117+ . find ( |comp| comp. contains ( component) )
118+ . cloned ( ) ;
119+ if let Some ( key) = key
120+ && let Some ( pb) = self . file_progress_bars . get ( & key)
121+ {
122+ pb. set_style (
123+ ProgressStyle :: with_template (
124+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now..." ,
125+ )
126+ . unwrap ( ) ,
127+ ) ;
128+ pb. finish ( ) ;
129+ }
130+ }
107131}
You can’t perform that action at this time.
0 commit comments