Skip to content

Commit

Permalink
fix #398
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Nov 26, 2024
1 parent b895f6d commit 0c7c550
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/geoflow_utils.R
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 0c7c550

Please sign in to comment.