Skip to content

Commit

Permalink
correct cran status checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Jun 2, 2024
1 parent 8a0c19a commit 0603b47
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions R/check-cran-status.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@
}

if (is.null(email) && !length(email)) {
email <- .try(get_description_emails())
if (inherits(email, "error")) {
return(invisible())
}
email <- .try(get_description_emails())
if (inherits(email, "error")) {
return(invisible())
}
}

cat("Checking CRAN status\n")
success <- FALSE
for (e in email) {
if (success) cat("\n")
cat("checking for", crayon_blue(e))
# shhhh
res <- fuj::wuffle(.try(utils::capture.output(dang::checkCRANStatus(e))))
res <- fuj::wuffle(.try(utils::capture.output(dang::checkCRANStatus(
email = e,
cache = tempfile("dang_check_cran_status__", fileext = ".rds"),
cache.life = 3600
))))
if (!inherits(res, "error")) {
show_table()
success <- TRUE
Expand All @@ -38,7 +41,7 @@

show_table <- function() {
res <- get_recent_cran_check()
time <- crayon_yellow(res[[1]])
time <- crayon_yellow(format(res[[1]], "%Y-%m-%d %H:%M:%S", usetz = TRUE))
tab <- res[[2]]

cat("\n")
Expand All @@ -47,7 +50,7 @@ show_table <- function() {
}

get_recent_cran_check <- function() {
files <- list.files(tempdir(), "^cran-status.*.rds$", full.names = TRUE)
files <- list.files(tempdir(), "^dang_check_cran_status__.*\\.rds$", full.names = TRUE)
res <- files[which.max(file.mtime(files))]
readRDS(res)
}
Expand Down Expand Up @@ -94,7 +97,7 @@ print_cran_status <- function(x) {
row[1L],
row[1L]
),
paste0(row[-1L], collapse = " ")
paste0(row[crayon_strip(row) != ""][-1L], collapse = " ")
)
})
return(invisible(xx))
Expand Down

0 comments on commit 0603b47

Please sign in to comment.