From 0f94a562fc9fa5e900cf799f25d4d3403428169e Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Thu, 18 Jul 2024 09:07:49 +0200 Subject: [PATCH] make the directory exists before writing to it #138 --- R/default_organisation.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/default_organisation.R b/R/default_organisation.R index dc53ead2..437ef6fc 100644 --- a/R/default_organisation.R +++ b/R/default_organisation.R @@ -13,7 +13,9 @@ #' @family both default_organisation <- function(org = organisation$new()) { assert_that(inherits(org, "organisation")) - R_user_dir("checklist", which = "config") |> + target <- R_user_dir("checklist", which = "config") + dir_create(target) + target |> path("organisation.yml") |> write_yaml(x = org$template) return(invisible(NULL))