R/zzz.R

Defines functions ui_confirm

ui_confirm <- function() {
    if (!interactive()) {
        cli::cli_alert_warning("User input requested, but session is not interactive.")
        cli::cli_alert_info("Assuming this is okay.")
        return(TRUE)
    }

    ans <- readline("Is this okay (y/n)? ")
    if (!ans %in% c("", "y", "Y")) stop("aborted", call. = FALSE)
    return(invisible(TRUE))
}

utils::globalVariables(c("uri", "bucket", "folder", "file_name", "file_path", "exists_already"))

Try the s3 package in your browser

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

s3 documentation built on Sept. 11, 2024, 7:03 p.m.