cloud_get_roots {cloudfs}R Documentation

Get cloud roots of a project

Description

Returns a list with all ⁠cloudfs.*⁠ roots defined in a project's DESCRIPTION.

Usage

cloud_get_roots(project = ".")

Arguments

project

Character. Path to a project. By default it is current working directory.

Value

A named list where each element corresponds to a ⁠cloudfs.*⁠ root defined in the project's DESCRIPTION file. The names of the list elements are derived from the ⁠cloudfs.*⁠ fields by removing the cloudfs. prefix.

Examples

# create a temp. folder, and put DESCRIPTION file with cloudfs.* fields into it
tmp_project <- file.path(tempdir(), "cloudfs")
if (!dir.exists(tmp_project)) dir.create(tmp_project)
tmp_project_desc <- file.path(tmp_project, "DESCRIPTION")
desc_content <- c(
  "Package: -",
  "cloudfs.s3: my_bucket/my_project",
  "cloudfs.drive: aaaaaa"
)
writeLines(desc_content, tmp_project_desc)

roots <- cloud_get_roots(tmp_project)
roots


[Package cloudfs version 0.1.3 Index]