File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ local_quarto_project <- function(
9191 return (file.path(path_tmp , name ))
9292}
9393
94+ local_clean_resources <- function (where , .env = parent.frame()) {
95+ skip_if_not_installed(" withr" )
96+ skip_if_not_installed(" fs" )
97+ # clean up output file
98+ files <- fs :: dir_ls(where , type = " directory" , glob = " *_files" )
99+ fs :: dir_delete(files )
100+ }
101+
94102.render <- function (
95103 input ,
96104 output_file = NULL ,
@@ -103,6 +111,7 @@ local_quarto_project <- function(
103111 skip_if_not_installed(" withr" )
104112 # work inside input directory
105113 withr :: local_dir(dirname(input ))
114+ local_clean_resources(where = " ." , .env = .env )
106115 output_file_forced <- NULL
107116 if (is.null(output_file )) {
108117 output_file_forced <- basename(withr :: local_file(
@@ -116,6 +125,7 @@ local_quarto_project <- function(
116125 output_file_forced
117126 )
118127 }
128+
119129 expect_no_error(quarto_render(
120130 basename(input ),
121131 output_file = output_file ,
You can’t perform that action at this time.
0 commit comments