Skip to content

Commit

Permalink
Collect some data about each universe
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 13, 2024
1 parent 323e6f5 commit 08a98ec
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions R/buildtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,13 @@ universe_name_fallback <- function(){

universe_info <- function(){
tryCatch({
gh::gh(sprintf('/users/%s', Sys.getenv('UNIVERSE_NAME', universe_name_fallback())))
name <- Sys.getenv('UNIVERSE_NAME', universe_name_fallback())
universe <- switch(name,
'bioc' = 'bioconductor',
'r-multiverse-staging' = 'r-multiverse',
name
)
gh::gh(sprintf('/users/%s', universe))
}, error = message)
}

Expand Down Expand Up @@ -793,8 +799,13 @@ generate_metadata_files <- function(package, repo, subdir, outdir, pkgdir, git_u
}
searchresults <- get_blackbird_count(package)
userinfo <- universe_info()
if(length(userinfo$type))
contents$usertype <- jsonlite::unbox(tolower(userinfo$type)) # universe (not owner)
if(length(userinfo$type)){
contents$info <- list(type = jsonlite::unbox(tolower(userinfo$type)))
contents$info$name <- jsonlite::unbox(ifelse(length(userinfo$name), userinfo$name, userinfo$login))
if(length(userinfo$bio)){
contents$info$bio <- jsonlite::unbox(userinfo$bio)
}
}
if(length(crandownloads))
contents$crandownloads <- jsonlite::unbox(crandownloads)
if(length(mentions))
Expand Down

0 comments on commit 08a98ec

Please sign in to comment.