Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Jan 17, 2024
1 parent 2833f69 commit 7a62336
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,17 @@ compact <- function(x) x[!vapply(x, is.null, logical(1))]

set_odbcsysini <- function() {
odbcsysini <- Sys.getenv("ODBCSYSINI")

if (!identical(odbcsysini, "")) {
return(invisible(TRUE))
}

odbcsysini <- tryCatch(odbcListConfig(), error = function(e) e)

if (inherits(odbcsysini, "error")) {
return(invisible(TRUE))
return(invisible())
}

odbcsysini <- dirname(odbcsysini[1])

Sys.setenv(ODBCSYSINI = odbcsysini)
tryCatch(
{
path <- dirname(odbcListConfig()$drivers)
Sys.setenv(ODBCSYSINI = path)
},
error = function(err) NULL
)

invisible(TRUE)
invisible()
}

0 comments on commit 7a62336

Please sign in to comment.