Skip to content

Commit

Permalink
Add loop across vector of repo paths
Browse files Browse the repository at this point in the history
  • Loading branch information
chartgerink committed Jan 31, 2024
1 parent 9acf98f commit 75725f2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions R/add-contributors.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,31 @@ add_contributors <- function (repo = ".",
alphabetical = FALSE,
open_issue = FALSE,
force_update = FALSE) {
ctbs <- add_contributors_one_repo(
repo,
# Init list
all_repos <- list(ctbs = data.frame())

for (rep in repo) {
one_repo <- add_contributors_one_repo(
repo = rep,
type,
exclude_label,
exclude_issues,
exclude_not_planned,
num_sections,
section_names,
format,
alphabetical
)
alphabetical)
all_repos$ctbs <- rbind(all_repos$ctbs, one_repo$ctbs)
all_repos$or <- one_repo$or
}

# Deduplicate if multiple repositories
if (length(repo) > 1) {
all_repos$ctbs <- all_repos$ctbs[!duplicated(all_repos$ctbs[c("logins")]), ]
}

chk <- add_contribs_to_files (
ctbs$ctbs, ctbs$or, ncols, format, files,
all_repos$ctbs, all_repos$or, ncols, format, files,
open_issue, force_update
)

Expand Down Expand Up @@ -165,7 +176,7 @@ add_contributors_one_repo <- function (

ctbs <- rename_default_sections (ctbs)

return(list(ctbs, or))
return(list(ctbs = ctbs, or = or))
}

match_type_arg <- function (type) {
Expand Down

0 comments on commit 75725f2

Please sign in to comment.