collection$get("file") and collection$get("./file") now return the same file
authorFuad Muhic <fmuhic@capeannenterprises.com>
Fri, 12 Jan 2018 11:06:04 +0000 (12:06 +0100)
committerFuad Muhic <fmuhic@capeannenterprises.com>
Fri, 12 Jan 2018 11:06:04 +0000 (12:06 +0100)
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic@capeannenterprises.com>

sdk/R/R/Arvados.R
sdk/R/R/CollectionTree.R

index d7f52e282450e98911acb5d17d53c1873475fda8..5515bfd58790a3ba71c0ed13a1ded8a16349a408 100644 (file)
@@ -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, "/")
index e024f5eb0f1802703d267b04693dd905876af081..b95b797b93b0266fc001f9408e10ec14e32f929f 100644 (file)
@@ -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)