From 50a06986d4f0419c8930939e6e99ebe1581a897c Mon Sep 17 00:00:00 2001 From: mischko Date: Thu, 14 Nov 2024 21:14:11 +0100 Subject: [PATCH 1/2] fix move file use fs::file_move instead of file_rename --- NAMESPACE | 1 + R/decision.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 9f54e55..3feb127 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,6 +32,7 @@ importFrom(dplyr,summarise) importFrom(dplyr,transmute) importFrom(dplyr,ungroup) importFrom(fs,file_exists) +importFrom(fs,file_move) importFrom(fs,path) importFrom(fs,path_dir) importFrom(fs,path_temp) diff --git a/R/decision.R b/R/decision.R index b25bb82..da5f2c9 100644 --- a/R/decision.R +++ b/R/decision.R @@ -21,6 +21,7 @@ #' @export #' @importFrom cli cli_inform #' @importFrom rlang check_installed +#' @importFrom fs file_move import_review = function(source_path="R/", output_path=get_target_dir(), background=getOption("autoimport_background", FALSE)) { @@ -114,7 +115,7 @@ review_app = function(data_files){ shiny::observeEvent(input$accept, { cli_inform(c(">"="Accepting modification of '{.file {old_path[[i()]]}}'")) - file.rename(new_path[[i()]], old_path[[i()]]) + fs::file_move(new_path[[i()]], old_path[[i()]]) update_cases() }) shiny::observeEvent(input$skip, { From ff2456c45d7ad6780e5849eba8b0ffb41af31725 Mon Sep 17 00:00:00 2001 From: mischko Date: Thu, 14 Nov 2024 21:58:55 +0100 Subject: [PATCH 2/2] remove package::function notation --- R/decision.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/decision.R b/R/decision.R index da5f2c9..f6d53c0 100644 --- a/R/decision.R +++ b/R/decision.R @@ -115,7 +115,7 @@ review_app = function(data_files){ shiny::observeEvent(input$accept, { cli_inform(c(">"="Accepting modification of '{.file {old_path[[i()]]}}'")) - fs::file_move(new_path[[i()]], old_path[[i()]]) + file_move(new_path[[i()]], old_path[[i()]]) update_cases() }) shiny::observeEvent(input$skip, {