File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -261,15 +261,13 @@ pgrs <- function(resp) {
261
261
}
262
262
263
263
if (! isTRUE(the $ str_prgs $ pb == the $ str_prgs $ f )) {
264
- # format outside glue statement to get rid of NOTE in R CMD check
265
- total_pretty <- prettyunits :: pretty_bytes(the $ str_prgs $ total )
266
264
cli :: cli_progress_bar(
267
265
name = the $ str_prgs $ f ,
268
266
type = " download" ,
269
267
format = paste0(
270
268
" {cli::pb_spin} downloading {str_prgs$f} " ,
271
- " ({str_prgs$done_pct} of {total_pretty )}) " ,
272
- " at {prettyunits::pretty_bytes(str_prgs$speed}/s"
269
+ " ({str_prgs$done_pct} of {prettyunits::pretty_bytes(str_prgs$total )}) " ,
270
+ " at {prettyunits::pretty_bytes(str_prgs$speed) }/s"
273
271
),
274
272
format_done = paste0(
275
273
" {cli::col_green(cli::symbol$tick)} downloaded {str_prgs$f}"
Original file line number Diff line number Diff line change @@ -57,7 +57,13 @@ pull_model <- function(model = NULL,
57
57
} else {
58
58
httr2 :: req_perform(req )
59
59
}
60
- cli :: cli_alert_success(" model {model} pulled succesfully" )
60
+ total <- try(as.integer(the $ str_prgs $ total ), silent = TRUE )
61
+ if (methods :: is(total , " try-error" )) {
62
+ cli :: cli_alert_success(" model {model} pulled succesfully" )
63
+ } else {
64
+ total <- prettyunits :: pretty_bytes(total )
65
+ cli :: cli_alert_success(" model {model} ({total}) pulled succesfully" )
66
+ }
61
67
the $ str_prgs <- NULL
62
68
63
69
invisible (show_model(model ))
You can’t perform that action at this time.
0 commit comments