Learn R Programming

cloudfs (version 0.1.3)

cloud_get_roots: 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 = ".")

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.

Arguments

project

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

Examples

Run this code
# 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

Run the code above in your browser using DataLab