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 {
133
133
return ;
134
134
} ;
135
135
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 ( ) ,
138
142
) ;
139
143
}
140
144
@@ -170,8 +174,11 @@ impl DownloadTracker {
170
174
&& let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
171
175
{
172
176
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
+ }
175
182
)
176
183
. unwrap ( )
177
184
. tick_chars ( r"|/-\ " ) ,
@@ -191,9 +198,11 @@ impl DownloadTracker {
191
198
&& let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
192
199
{
193
200
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
+ } )
197
206
. unwrap ( ) ,
198
207
) ;
199
208
pb. finish ( ) ;
You can’t perform that action at this time.
0 commit comments