Skip to content

Commit

Permalink
add some safety
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 2, 2023
1 parent 1f32bd1 commit 4b0af24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ delete_from_server <- function(universe){
# Get current submodules
out <- sys::exec_internal('git', c('config', '--file', '.gitmodules', '--get-regexp', '\\.path$'))
submodules <- vapply(strsplit(sys::as_text(out$stdout), ' ', fixed = TRUE), `[[`, character(1), 2)
submodules <- unique(c(submodules, list.files())) # Just in case...
caterr("Current submodules:", paste(submodules, collapse = ', '), '\n\n')
pkgs <- jsonlite::fromJSON(paste0(cranlike_url, '/api/ls'))
deleted <- pkgs[!(pkgs %in% submodules)]
Expand All @@ -42,7 +43,7 @@ delete_from_server <- function(universe){
}

# Delete docs for packages that were removed
if(basename(monorepo_url) == 'ropensci'){
if(universe == 'ropensci'){
repos <- list_ropensci_docs_repos()
packages <- c(submodules, 'ropensci-docs.github.io')
deleted <- repos[!(tolower(repos) %in% tolower(packages))]
Expand Down

0 comments on commit 4b0af24

Please sign in to comment.