R/utils_progress.R

Defines functions progress_terminate progress_update progress_init

# Must be tested interactively: tests/interactive/test-utils_progress.R
# nocov start
progress_init <- function(verbose, total) {
  if (!verbose || !interactive() || total < 2L) {
    return(NULL)
  }
  parent <- parent.frame()
  progress <- new.env(parent = parent)
  cli::cli_progress_bar(total = total, .envir = progress)
  progress
}

progress_update <- function(progress) {
  if (is.null(progress)) {
    return(NULL)
  }
  cli::cli_progress_update(.envir = progress)
}

progress_terminate <- function(progress) {
  if (is.null(progress)) {
    return(NULL)
  }
  cli::cli_progress_done(.envir = progress)
}
# nocov end

Try the crew.aws.batch package in your browser

Any scripts or data that you put into this service are public.

crew.aws.batch documentation built on June 9, 2025, 5:09 p.m.