Skip to content

Commit

Permalink
Remove PACKAGES files if Wasm repo is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Aug 6, 2024
1 parent 32b514c commit 7187343
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions R/repo.R
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,17 @@ update_repo <- function(package_info,
}

update_packages <- function(contrib_src, contrib_bin) {
tools::write_PACKAGES(contrib_src, verbose = TRUE)
tools::write_PACKAGES(contrib_bin, verbose = TRUE, type = "mac.binary")
invisible(NULL)
if (any(c(
grepl(".tar.gz", fs::dir_ls(contrib_src)),
grepl(".tgz", fs::dir_ls(contrib_bin))
))) {
tools::write_PACKAGES(contrib_src, verbose = TRUE)
tools::write_PACKAGES(contrib_bin, verbose = TRUE, type = "mac.binary")
invisible(TRUE)
} else {
# If the repo is empty, just wipe PACKAGES
fs::dir_delete(contrib_src)
fs::dir_delete(contrib_bin)
invisible(FALSE)
}
}

0 comments on commit 7187343

Please sign in to comment.