File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ Imports:
2727 rstudioapi,
2828 tools,
2929 utils,
30- withr,
3130 yaml
3231Suggests:
3332 bslib,
Original file line number Diff line number Diff line change @@ -129,20 +129,32 @@ quarto_run <- function(
129129 ... ,
130130 .call = rlang :: caller_env()
131131) {
132- # handle R_LIBS
132+ # To store any environment variables to pass to the process
133+ custom_env <- NULL
134+
135+ # handle session .libpaths() for background session
136+ # It needs to be passed if .libPaths() was modified in the current R session
137+ # (e.g. to install dev package in a temporary library)
133138 opt_in_libpath <- getOption(" quarto.use_libpaths" , TRUE )
134139 if (isTRUE(opt_in_libpath ) && ! is.null(libpaths )) {
135- withr :: local_envvar(list (
140+ custom_env <- c(
141+ custom_env ,
136142 R_LIBS = paste(libpaths , collapse = .Platform $ path.sep )
137- ))
143+ )
138144 }
139145
140146 # This is required due to a bug in QUARTO CLI, fixed only in 1.8+
141147 # https://github.com/quarto-dev/quarto-cli/pull/12887
142- custom_env <- NULL
143148 if (! quarto_available(min = " 1.8.13" )) {
144- custom_env <- c(" current " , QUARTO_R = R.home(" bin" ))
149+ custom_env <- c(custom_env , QUARTO_R = R.home(" bin" ))
145150 }
151+
152+ # This is required because `"current"` only is not supported by processx
153+ # FIXME: https://github.com/r-lib/processx/issues/399
154+ if (! is.null(custom_env )) {
155+ custom_env <- c(" current" , custom_env )
156+ }
157+
146158 res <- tryCatch(
147159 {
148160 processx :: run(
You can’t perform that action at this time.
0 commit comments