File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ quarto_use_template <- function(
3636) {
3737 rlang :: check_required(template )
3838
39+ if (! fs :: dir_exists(dir )) {
40+ fs :: dir_create(dir )
41+ }
42+
3943 if (! is_empty_dir(dir ) && quarto_available(" 1.5.15" )) {
4044 cli :: cli_abort(c(
4145 " {.arg dir} must be an empty directory." ,
Original file line number Diff line number Diff line change @@ -106,7 +106,10 @@ has_internet <- function(host = "https://www.google.com") {
106106
107107is_empty_dir <- function (dir ) {
108108 if (! dir.exists(dir )) {
109- return (FALSE )
109+ rlang :: warn(
110+ " Directory {.path {dir}} does not exist. Assuming it is empty."
111+ )
112+ return (TRUE )
110113 }
111114 files <- list.files(dir , all.files = TRUE , no.. = TRUE )
112115 length(files ) == 0
You can’t perform that action at this time.
0 commit comments