From: Fuad Muhic Date: Fri, 12 Jan 2018 11:06:04 +0000 (+0100) Subject: collection$get("file") and collection$get("./file") now return the same file X-Git-Tag: 1.1.3~2^2~33 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/b0f36fd28ee29321d368852bd14b61485e758af3 collection$get("file") and collection$get("./file") now return the same file Arvados-DCO-1.1-Signed-off-by: Fuad Muhic --- diff --git a/sdk/R/R/Arvados.R b/sdk/R/R/Arvados.R index d7f52e2824..5515bfd587 100644 --- a/sdk/R/R/Arvados.R +++ b/sdk/R/R/Arvados.R @@ -18,7 +18,7 @@ Arvados <- R6::R6Class( initialize = function(auth_token = NULL, host_name = NULL) { if(!is.null(host_name)) - Sys.setenv(ARVADOS_API_HOST = host_name) + Sys.setenv(ARVADOS_API_HOST = host_name) if(!is.null(auth_token)) Sys.setenv(ARVADOS_API_TOKEN = auth_token) @@ -29,7 +29,7 @@ Arvados <- R6::R6Class( if(host_name == "" | token == "") stop(paste0("Please provide host name and authentification token", " or set ARVADOS_API_HOST and ARVADOS_API_TOKEN", - " environmental variables.")) + " environment variables.")) version <- "v1" host <- paste0("https://", host_name, "/arvados/", version, "/") diff --git a/sdk/R/R/CollectionTree.R b/sdk/R/R/CollectionTree.R index e024f5eb0f..b95b797b93 100644 --- a/sdk/R/R/CollectionTree.R +++ b/sdk/R/R/CollectionTree.R @@ -37,6 +37,9 @@ CollectionTree <- R6::R6Class( getElement = function(relativePath) { + if(startsWith(relativePath, "./")) + relativePath <- substr(relativePath, 3, nchar(relativePath)) + if(endsWith(relativePath, "/")) relativePath <- substr(relativePath, 0, nchar(relativePath) - 1)