@@ -91,7 +91,13 @@ local_quarto_project <- function(
9191 return (file.path(path_tmp , name ))
9292}
9393
94- .render <- function (input , output_file = NULL , ... , .env = parent.frame()) {
94+ .render <- function (
95+ input ,
96+ output_file = NULL ,
97+ ... ,
98+ .quiet = TRUE ,
99+ .env = parent.frame()
100+ ) {
95101 skip_if_no_quarto()
96102 skip_if_not_installed(" withr" )
97103 # work inside input directory
@@ -102,7 +108,12 @@ local_quarto_project <- function(
102108 .local_envir = .env
103109 ))
104110 }
105- quarto_render(basename(input ), output_file = output_file , quiet = TRUE , ... )
111+ expect_no_error(quarto_render(
112+ basename(input ),
113+ output_file = output_file ,
114+ quiet = .quiet ,
115+ ...
116+ ))
106117 expect_true(file.exists(output_file ))
107118 normalizePath(output_file )
108119}
@@ -240,3 +251,34 @@ local_quarto_run_echo_cmd <- function(.env = parent.frame()) {
240251 withr :: local_options(quarto.echo_cmd = TRUE , .local_envir = .env )
241252 }
242253}
254+
255+ quick_install <- function (package , lib , quiet = TRUE ) {
256+ skip_if_not_installed(" callr" )
257+ opts <- c(
258+ " --data-compress=none" ,
259+ " --no-byte-compile" ,
260+ " --no-data" ,
261+ " --no-demo" ,
262+ " --no-docs" ,
263+ " --no-help" ,
264+ " --no-html" ,
265+ " --no-libs" ,
266+ " --use-vanilla" ,
267+ sprintf(" --library=%s" , lib ),
268+ package
269+ )
270+ invisible (callr :: rcmd(" INSTALL" , opts , show = ! quiet , fail_on_status = TRUE ))
271+ }
272+
273+ install_dev_package <- function (.local_envir = parent.frame()) {
274+ # if not inside of R CMD check, install dev version into temp directory
275+ if (Sys.getenv(" _R_CHECK_TIMINGS_" ) == " " ) {
276+ skip_if_not_installed(" pkgload" )
277+ withr :: local_temp_libpaths(.local_envir = .local_envir )
278+ quick_install(pkgload :: pkg_path(" ." ), lib = .libPaths()[1 ])
279+ withr :: local_envvar(
280+ R_LIBS = paste0(.libPaths(), collapse = .Platform $ path.sep ),
281+ .local_envir = .local_envir
282+ )
283+ }
284+ }
0 commit comments