Skip to content

Commit

Permalink
Wrap in render() in Rscript_call() to isolate env session
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed May 3, 2024
1 parent 8e2a1de commit f6e5a9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ BugReports: https://github.com/epiverse-trace/episoap/issues
Imports:
renv (>= 0.13.0),
rmarkdown,
withr
withr,
xfun
Suggests:
knitr,
spelling,
Expand Down
7 changes: 4 additions & 3 deletions R/run_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ run_pipeline <- function(
package = "episoap",
edit = FALSE
)
rmarkdown::render(
paste0(r, ".Rmd"),
params = list(...)
# We run in a new session the prevent renv to leak in the user's environment
xfun::Rscript_call(
rmarkdown::render,
list(input = paste0(r, ".Rmd"), params = list(...))
)
}, character(1))

Expand Down

0 comments on commit f6e5a9b

Please sign in to comment.