From 14510dc4375d52a666a2b2b35051e3e1073d6afa Mon Sep 17 00:00:00 2001 From: Brendan Hogan Date: Thu, 4 Jun 2020 07:08:11 -0400 Subject: [PATCH] attempt to render tutorial file in a tempdir #347 --- R/run.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/run.R b/R/run.R index 39177889c..b2655a503 100644 --- a/R/run.R +++ b/R/run.R @@ -51,13 +51,17 @@ run_tutorial <- function(name = NULL, package = NULL, shiny_args = NULL) { ) } + # set rmarkdown args to render in tmp dir + render_args <- list(output_dir = tempdir()) + # run within tutorial wd withr::with_dir(tutorial_path, { if (!identical(Sys.getenv("SHINY_PORT", ""), "")) { # is currently running in a server, do not allow for prerender (rmarkdown::render) withr::local_envvar(c(RMARKDOWN_RUN_PRERENDER = "0")) } - rmarkdown::run(file = NULL, dir = tutorial_path, shiny_args = shiny_args) + rmarkdown::run(file = NULL, dir = tutorial_path, shiny_args = shiny_args, + render_args = render_args) }) }