From 4c89e4bd29950866b04f6b61dbc3ee86d452e85f Mon Sep 17 00:00:00 2001 From: eblondel Date: Mon, 28 Oct 2024 00:39:37 +0100 Subject: [PATCH] fix #395 --- R/geoflow_data.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/geoflow_data.R b/R/geoflow_data.R index 9f44e8aa..27ff4ff8 100644 --- a/R/geoflow_data.R +++ b/R/geoflow_data.R @@ -435,6 +435,7 @@ geoflow_data <- R6Class("geoflow_data", self$dir <- data_dir ext_data_files <- list() ext_sld_files <- list() + all_data_files = list.files(data_dir, full.names = T) if(self$access == "default"){ if(!is_absolute_path(data_dir) && !is.null(config)) data_dir <- file.path(config$session_wd, datasource_uri) if(!dir.exists(data_dir)){ @@ -451,7 +452,7 @@ geoflow_data <- R6Class("geoflow_data", ) ext_data_files <- list.files(data_dir, pattern = paste0(".", ext), full.names = T) }else{ - ext_data_files <- list.files(data_dir, full.names = T) + ext_data_files <- all_data_files } #exclude dirs ext_data_files = ext_data_files[!dir.exists(ext_data_files)] @@ -485,14 +486,14 @@ geoflow_data <- R6Class("geoflow_data", } } - if(length(ext_data_files)>0){ - ext_sld_files <- ext_data_files[endsWith(ext_data_files,".sld")] + if(length(all_data_files)>0){ + ext_sld_files <- all_data_files[endsWith(all_data_files,".sld")] ext_data_files <-ext_data_files[!endsWith(ext_data_files,".sld")] } #detect presence of data files register data_files_register <- NULL - data_files_register_file = ext_data_files[basename(ext_data_files) == "register.csv"] + data_files_register_file = all_data_files[basename(all_data_files) == "register.csv"] if(length(data_files_register_file)>0){ data_files_register_file = data_files_register_file[1] target_register_file = data_files_register_file