Skip to content

Commit

Permalink
set rmarkdown_run_prerender to 0 if shiny_port envvar is found
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Sep 6, 2018
1 parent be6043c commit 942df45
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 @@ -35,8 +35,12 @@ run_tutorial <- function(name, package, shiny_args = NULL) {
)
}

# run within tutorial wd and ensure we don't call rmarkdown::render
# 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)
})
}
Expand Down

0 comments on commit 942df45

Please sign in to comment.