Skip to content

Commit

Permalink
Fix issue w/ get_data_dir()
Browse files Browse the repository at this point in the history
  • Loading branch information
elipousson committed Nov 11, 2024
1 parent 00a9c30 commit fc0b548
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/standalone-get-data-dir.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#
# ## Changelog
#
# 2024-11-11:
# * Fix issue with `get_data_dir()` on Windows by setting `dir.create(recursive =
# TRUE)`. `recursive` is exposed to allow overrides.
#
# 2024-09-12:
# * Initial setup.
#
Expand All @@ -35,6 +39,7 @@
#' @param ask If `TRUE`, create is `FALSE`, and session is interactive, ask to
#' create directory if the provided directory does not exist.
#' @param quiet If `TRUE`, suppress informational messages.
#' @inheritParams base::dir.create
#' @inheritParams rlang::args_error_context
#' @export
#' @importFrom cliExtras cli_yesno
Expand All @@ -49,6 +54,7 @@ get_data_dir <- function(path = NULL,
pkg = NULL,
allow_null = TRUE,
quiet = FALSE,
recursive = TRUE,
call = caller_env()) {
appname <- appname %||% pkg
cli_quiet(quiet)
Expand Down Expand Up @@ -99,7 +105,7 @@ get_data_dir <- function(path = NULL,
"New directory created at {.file {path}}"
)

dir.create(path)
dir.create(path, recursive = recursive)
invisible(path)
}

Expand Down
4 changes: 4 additions & 0 deletions man/get_data_dir.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc0b548

Please sign in to comment.