Skip to content

Commit 8a85fc9

Browse files
committed
Silence some outputs
1 parent b943a88 commit 8a85fc9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

R/blackbird.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ get_blackbird_count <- function(package){
2222

2323
make_session_handle <- function(){
2424
agent <- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36'
25-
curl::new_handle(useragent = agent, cookie = sprintf("user_session=%s;", Sys.getenv("DUMMY_SESSION")))
25+
session <- Sys.getenv("DUMMY_SESSION")
26+
if(!nchar(session))
27+
stop("No dummy session, skipping script count")
28+
curl::new_handle(useragent = agent, cookie = sprintf("user_session=%s;", session))
2629
}
2730

2831
#out <- get_blackbird_count('dplyr')

R/buildtools.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,12 @@ universe_info <- function(){
603603

604604
current_info <- function(package){
605605
tryCatch({
606-
url <- paste0(Sys.getenv('MY_UNIVERSE', 'https://cran.r-universe.dev'), '/', package, '/json')
607-
message("Looking up current package info: ", url)
608-
jsonlite::fromJSON(url)
606+
universe <- Sys.getenv('MY_UNIVERSE')
607+
if(nchar(universe)){
608+
url <- paste0(universe, '/', package, '/json')
609+
message("Looking up current package info: ", url)
610+
jsonlite::fromJSON(url)
611+
}
609612
}, error = message)
610613
}
611614

0 commit comments

Comments
 (0)