Skip to content

Commit 2aea71c

Browse files
committed
update config.R (for old Rtools)
1 parent 39b8735 commit 2aea71c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/config.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ read_r_config <- function(
149149
on.exit(setwd(owd), add = TRUE)
150150
R <- file.path(R.home("bin"), "R")
151151

152+
# suppress cygwin path warnings for windows
153+
if (Sys.info()[["sysname"]] == "Windows") {
154+
CYGWIN <- Sys.getenv("CYGWIN")
155+
Sys.setenv(CYGWIN = "nodosfilewarning")
156+
on.exit(Sys.setenv(CYGWIN = CYGWIN), add = TRUE)
157+
}
158+
152159
values <- unlist(list(...), recursive = TRUE)
153160
if (length(values) == 0) {
154161
if (verbose)
@@ -168,6 +175,9 @@ read_r_config <- function(
168175
names(config) <- values
169176
}
170177

178+
if (is.null(envir))
179+
return(config)
180+
171181
list2env(config, envir = envir)
172182
}
173183

0 commit comments

Comments
 (0)