@@ -150,29 +150,8 @@ quarto_run <- function(
150150 if (isTRUE(opt_in_libpath ) && ! is.null(libpaths )) {
151151 custom_env <- c(
152152 custom_env ,
153- R_LIBS = paste(libpaths , collapse = .Platform $ path.sep )
153+ R_LIBS_USER = paste(libpaths , collapse = .Platform $ path.sep )
154154 )
155-
156- # On Windows, also pass via QUARTO_KNITR_RSCRIPT_ARGS as a workaround
157- # for environment variables not being inherited by Rscript subprocess
158- # https://github.com/quarto-dev/quarto-r/issues/217
159- if (.Platform $ OS.type == " windows" ) {
160- # Create a wrapper script that sets .libPaths() then sources rmd.R
161- wrapper_content <- sprintf(
162- ' .libPaths(c(%s, .libPaths()))\n args <- commandArgs(trailingOnly = FALSE)\n source(args[length(args)])' ,
163- paste(deparse(libpaths ), collapse = " " )
164- )
165- wrapper_file <- tempfile(" quarto_libpaths_" , fileext = " .R" )
166- writeLines(wrapper_content , wrapper_file )
167-
168- # Use --file=wrapper to execute our wrapper, which then sources rmd.R
169- existing_args <- Sys.getenv(" QUARTO_KNITR_RSCRIPT_ARGS" , " " )
170- new_args <- paste0(" --file=" , wrapper_file )
171- if (nzchar(existing_args )) {
172- new_args <- paste(existing_args , new_args , sep = " ," )
173- }
174- custom_env <- c(custom_env , QUARTO_KNITR_RSCRIPT_ARGS = new_args )
175- }
176155 }
177156
178157 # This is required because `"current"` only is not supported by processx
0 commit comments