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 @@ -128,8 +128,12 @@ impl DownloadTracker {
128
128
return ;
129
129
} ;
130
130
pb. set_style (
131
- ProgressStyle :: with_template ( "{msg:>12.bold} downloaded {total_bytes} in {elapsed}" )
132
- . unwrap ( ) ,
131
+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
132
+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed}"
133
+ } else {
134
+ "{msg:>12.bold} component already downloaded"
135
+ } )
136
+ . unwrap ( ) ,
133
137
) ;
134
138
}
135
139
@@ -165,8 +169,11 @@ impl DownloadTracker {
165
169
&& let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
166
170
{
167
171
pb. set_style (
168
- ProgressStyle :: with_template (
169
- "{msg:>12.bold} downloaded {total_bytes} in {elapsed} installing now {spinner:.green}" ,
172
+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
173
+ "{msg:>12.bold} downloaded {total_bytes} in {elapsed} and installing {spinner:.green}"
174
+ } else {
175
+ "{msg:>12.bold} component already downloaded and installing {spinner:.green}"
176
+ }
170
177
)
171
178
. unwrap ( )
172
179
. tick_chars ( r"|/-\ " ) ,
@@ -186,9 +193,11 @@ impl DownloadTracker {
186
193
&& let Some ( ( pb, _) ) = self . file_progress_bars . get ( & key)
187
194
{
188
195
pb. set_style (
189
- ProgressStyle :: with_template (
190
- "{msg:>12.bold} downloaded {total_bytes} and installed" ,
191
- )
196
+ ProgressStyle :: with_template ( if pb. position ( ) != 0 {
197
+ "{msg:>12.bold} downloaded {total_bytes} and installed"
198
+ } else {
199
+ "{msg:>12.bold} component already downloaded and installed"
200
+ } )
192
201
. unwrap ( ) ,
193
202
) ;
194
203
pb. finish ( ) ;
You can’t perform that action at this time.
0 commit comments