From db3b0531af4831c18b60aafce9e181ccda8a583c Mon Sep 17 00:00:00 2001 From: pat-s Date: Sun, 3 Nov 2024 23:00:29 +0100 Subject: [PATCH] fix: account for non-pkg items in counting unique files --- R/package_index.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/package_index.R b/R/package_index.R index 246b70e..cbe92ca 100644 --- a/R/package_index.R +++ b/R/package_index.R @@ -93,9 +93,9 @@ upload_package_index <- function( cli::cli_alert("{.fun upload_package_index}: Started listing remote packages") pkgs <- s3fs::s3_dir_ls(remote_bin_dir) cli::cli_alert_success("{.fun upload_package_index}: Finished listing remote packages") - # We remove 4 from the count as we don't want to count the PACKAGES* files - pkg_count <- length(pkgs) - 4 - unique_pkgs <- length(unique(sapply(strsplit(basename(pkgs), "_"), function(x) x[1]))) + # We remove 4 from the count as we don't want to count the PACKAGES* files + Archive/ dir + pkg_count <- length(pkgs) - 5 + unique_pkgs <- length(unique(sapply(strsplit(basename(pkgs), "_"), function(x) x[1]))) - 5 t1 <- Sys.time() cranlike::update_PACKAGES(sprintf("s3://%s", remote_bin_dir))