File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,12 @@ impl DownloadTracker {
133133 return ;
134134 } ;
135135 pb. set_style (
136- ProgressStyle :: with_template ( "{msg:>12.bold} downloaded {total_bytes} in {elapsed}" )
137- . unwrap ( ) ,
136+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
137+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed}"
138+ } else {
139+ "{msg:>12.bold} component already downloaded"
140+ } )
141+ . unwrap ( ) ,
138142 ) ;
139143 }
140144
@@ -170,8 +174,11 @@ impl DownloadTracker {
170174 && let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
171175 {
172176 pb. set_style (
173- ProgressStyle :: with_template (
174- "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now {spinner:.green}" ,
177+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
178+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now {spinner:.green}"
179+ } else {
180+ "{msg:>12.bold} component already downloaded, installing now {spinner:.green}"
181+ }
175182 )
176183 . unwrap ( )
177184 . tick_chars ( r"|/-\ " ) ,
@@ -191,9 +198,11 @@ impl DownloadTracker {
191198 && let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
192199 {
193200 pb. set_style (
194- ProgressStyle :: with_template (
195- "{msg:>12.bold} downloaded {total_bytes} and installed" ,
196- )
201+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
202+ "{msg:>12.bold} downloaded {total_bytes} and installed"
203+ } else {
204+ "{msg:>12.bold} component already downloaded and installed"
205+ } )
197206 . unwrap ( ) ,
198207 ) ;
199208 pb. finish ( ) ;
You can’t perform that action at this time.
0 commit comments