don't index package_name as list
This commit is contained in:
parent
2eed67c54a
commit
c0b8fd67f9
2 changed files with 6 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#' @export
|
||||
#' @examples
|
||||
#' archive_package("AATtools", codename = "rhel9")
|
||||
#' archive_package("asbio", codename = "rhel9", arch = "amd64")
|
||||
#' archive_package("adw", codename = "rhel8", arch = "amd64")
|
||||
#'
|
||||
archive_package <- function(
|
||||
package_name,
|
||||
|
|
@ -57,6 +57,7 @@ archive_package <- function(
|
|||
all_versions <- grep(sprintf("/%s_", .x), files, value = TRUE)
|
||||
# only archive if more than one package exists in the root
|
||||
if (length(all_versions) > 1) {
|
||||
|
||||
# get most recent version from CRAN
|
||||
last_version <- available.packages("https://cloud.r-project.org/src/contrib")[.x, "Version"]
|
||||
# check if last version is available in repo
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
t1 <- Sys.time()
|
||||
cli::cli_h2("Building ({.pkg {package_name[1]}})")
|
||||
|
||||
cli::cli_alert("[{format(Sys.time(), format='%H:%M:%S')}] Building binaries for {.pkg {package_name[[1]]}} with tags {.field {tag}}.")
|
||||
cli::cli_alert("[{format(Sys.time(), format='%H:%M:%S')}] Building binaries for {.pkg {package_name[1]}} with tags {.field {tag}}.")
|
||||
|
||||
future::plan(future_strategy,
|
||||
workers = future_workers,
|
||||
|
|
@ -125,7 +125,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
)
|
||||
|
||||
total_build_time <- round(Sys.time() - t1, 2)
|
||||
cli::cli_alert("Execution time ({.pkg {package_name[[1]]}}) ({length(tag)} tags): {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.")
|
||||
cli::cli_alert("Execution time ({.pkg {package_name[1]}}) ({length(tag)} tags): {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.")
|
||||
|
||||
cli::cli_h2("Uploading ({.pkg {package_name[1]}})")
|
||||
# out <- progressr::with_progress({
|
||||
|
|
@ -145,7 +145,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
})
|
||||
|
||||
if (archive) {
|
||||
archive_package(package_name[[1]])
|
||||
archive_package(package_name[1])
|
||||
}
|
||||
return(invisible(TRUE))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue