From 0c7c550fae8a28d62e6d21fc1917396ac0fd30da Mon Sep 17 00:00:00 2001 From: eblondel Date: Tue, 26 Nov 2024 14:37:45 +0100 Subject: [PATCH] fix #398 --- R/geoflow_utils.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/geoflow_utils.R b/R/geoflow_utils.R index 032eb78..92c6467 100644 --- a/R/geoflow_utils.R +++ b/R/geoflow_utils.R @@ -655,8 +655,15 @@ get_config_resource_path <- function(config, path){ is_url <- regexpr("(http|https)[^([:blank:]|\\\"|<|&|#\n\r)]+", path) > 0 if(is_url) return(path) if(!is_absolute_path(path)){ + path_root = config$root + mtch = gregexpr("\\.\\./", path)[[1]] + mtch = mtch[mtch != -1] + if(length(mtch)>0) for(i in 1:length(mtch)){ + path_root = dirname(path_root) + } + path = gsub("\\.\\./", "", path) if(startsWith("./", path)) path = unlist(strsplit(path, "\\./"))[2] - path = file.path(config$root, path) + path = file.path(path_root, path) } return(path) }