Skip to content

Commit

Permalink
attempt to render tutorial file in a tempdir rstudio#347
Browse files Browse the repository at this point in the history
  • Loading branch information
bhogan-mitre committed Jun 4, 2020
1 parent c8fde49 commit 14510dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down

0 comments on commit 14510dc

Please sign in to comment.