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 {
73
73
self . retrying_download ( url) ;
74
74
true
75
75
}
76
+ Notification :: Install ( In :: InstallingComponent ( component, _, _) ) => {
77
+ self . installing_component ( component) ;
78
+ true
79
+ }
76
80
_ => false ,
77
81
}
78
82
}
@@ -151,4 +155,24 @@ impl DownloadTracker {
151
155
* retry_time = Some ( Instant :: now ( ) ) ;
152
156
pb. set_style ( ProgressStyle :: with_template ( "{msg:>12.bold} retrying download" ) . unwrap ( ) ) ;
153
157
}
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
+ }
154
178
}
You can’t perform that action at this time.
0 commit comments