@@ -194,7 +194,7 @@ impl<'a> DownloadCfg<'a> {
194194 let progress = ProgressBar :: hidden ( ) ;
195195 progress. set_style (
196196 ProgressStyle :: with_template (
197- "{msg:>12.bold} [{bar:40 }] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})" ,
197+ "{msg:>12.bold} [{bar:30 }] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})" ,
198198 )
199199 . unwrap ( )
200200 . progress_chars ( "## " ) ,
@@ -260,7 +260,7 @@ impl DownloadStatus {
260260 * retry_time = None ;
261261 self . progress . set_style (
262262 ProgressStyle :: with_template (
263- "{msg:>12.bold} [{bar:40 }] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})" ,
263+ "{msg:>12.bold} [{bar:30 }] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})" ,
264264 )
265265 . unwrap ( )
266266 . progress_chars ( "## " ) ,
@@ -269,10 +269,10 @@ impl DownloadStatus {
269269
270270 pub ( crate ) fn finished ( & self ) {
271271 self . progress . set_style (
272- ProgressStyle :: with_template ( "{msg:>12.bold} downloaded {total_bytes} in {elapsed }" )
272+ ProgressStyle :: with_template ( "{msg:>12.bold} pending installation {total_bytes:>10 }" )
273273 . unwrap ( ) ,
274274 ) ;
275- self . progress . finish ( ) ;
275+ self . progress . tick ( ) ; // A tick is needed for the new style to appear, as it is static.
276276 }
277277
278278 pub ( crate ) fn failed ( & self ) {
@@ -285,8 +285,27 @@ impl DownloadStatus {
285285
286286 pub ( crate ) fn retrying ( & self ) {
287287 * self . retry_time . lock ( ) . unwrap ( ) = Some ( Instant :: now ( ) ) ;
288- self . progress
289- . set_style ( ProgressStyle :: with_template ( "{msg:>12.bold} retrying download" ) . unwrap ( ) ) ;
288+ self . progress . set_style (
289+ ProgressStyle :: with_template ( "{msg:>12.bold} retrying download..." ) . unwrap ( ) ,
290+ ) ;
291+ }
292+
293+ pub ( crate ) fn installing ( & self ) {
294+ self . progress . set_style (
295+ ProgressStyle :: with_template (
296+ "{msg:>12.bold} installing {spinner:.green} {total_bytes:>18}" ,
297+ )
298+ . unwrap ( )
299+ . tick_chars ( r"|/-\ " ) ,
300+ ) ;
301+ self . progress . enable_steady_tick ( Duration :: from_millis ( 100 ) ) ;
302+ }
303+
304+ pub ( crate ) fn installed ( & self ) {
305+ self . progress . set_style (
306+ ProgressStyle :: with_template ( "{msg:>12.bold} installed {total_bytes:>21}" ) . unwrap ( ) ,
307+ ) ;
308+ self . progress . finish ( ) ;
290309 }
291310}
292311
0 commit comments