From db9906c669eaf682eaa2b3276b1de13de4b1375e Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Thu, 26 Sep 2024 08:00:50 -0700 Subject: [PATCH] suppress warnings when fragile caught system calls fail --- R/reproducibility_tables.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/reproducibility_tables.R b/R/reproducibility_tables.R index 3305516..865073a 100644 --- a/R/reproducibility_tables.R +++ b/R/reproducibility_tables.R @@ -35,7 +35,7 @@ get_full_name <- function(id = NULL){ Linux = { if (is.null(id)) {id <- Sys.getenv("USER")} myargs <- paste0("-x -h ldapint.pc.scharp.org -b dc=scharp,dc=org uid=", id) - user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE)}, + user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE, stderr = FALSE)}, warning = function(w){NULL}, error = function(e){NULL}) user <- user[grep("cn:", user)] @@ -48,7 +48,7 @@ get_full_name <- function(id = NULL){ Darwin = { if (is.null(id)) {id <- Sys.getenv("USER")} myargs <- paste0("-x -h ldapint.pc.scharp.org -b dc=scharp,dc=org uid=", id) - user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE)}, + user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE, stderr = FALSE)}, warning = function(w){NULL}, error = function(e){NULL}) user <- user[grep("cn:", user)]