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 {
59
59
self . create_progress_bar ( component. to_owned ( ) , url. to_owned ( ) ) ;
60
60
true
61
61
}
62
+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
63
+ self . installing_component ( component) ;
64
+ true
65
+ }
62
66
_ => false ,
63
67
}
64
68
}
@@ -104,4 +108,24 @@ impl DownloadTracker {
104
108
) ;
105
109
pb. finish ( ) ;
106
110
}
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
+ }
107
131
}
You can’t perform that action at this time.
0 commit comments