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 {
68
68
self . retrying_download ( url) ;
69
69
true
70
70
}
71
+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
72
+ self . installing_component ( component) ;
73
+ true
74
+ }
71
75
_ => false ,
72
76
}
73
77
}
@@ -146,4 +150,24 @@ impl DownloadTracker {
146
150
* retry_time = Some ( Instant :: now ( ) ) ;
147
151
pb. set_style ( ProgressStyle :: with_template ( "{msg:>12.bold} retrying download" ) . unwrap ( ) ) ;
148
152
}
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
+ }
149
173
}
You can’t perform that action at this time.
0 commit comments