From 31eb137a0ce8b658e50769e50951c800c613f425 Mon Sep 17 00:00:00 2001 From: Niels Bock <144215822+nielsbock@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:54:26 +0200 Subject: [PATCH] fix download_data until rap_copy_from is ready granted that that username will be added to data_file_name --- R/import-data.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/import-data.R b/R/import-data.R index c034f3e..e5d39b8 100644 --- a/R/import-data.R +++ b/R/import-data.R @@ -25,10 +25,11 @@ download_data <- function(project_id = get_rap_project_id(), with = "rap_copy_from()" ) file_ext <- rlang::arg_match(file_ext) - rap_path <- rap_get_path_user_files(rap_get_user()) |> + rap_file <- rap_get_path_user_files(rap_get_user()) |> stringr::str_subset(file_ext) |> stringr::str_sort(decreasing = TRUE) |> head(1) + rap_path <- glue::glue("/users/{username}/{rap_file}") cli::cli_alert_info("Downloading from RAP: {.val {rap_path}}.") output_path <- glue::glue("data/data.{file_ext}")