List the files a collection bundles
Value
A webrarian_files list with the configured include and
exclude patterns, the mount_point, and files, the paths (relative to
the collection) that bind() would bundle. Every element is present, and
empty when nothing is configured.
Examples
collection <- file.path(tempdir(), "webrarian-files-demo")
catalog(collection)
#> ✔ Created directory /tmp/RtmpQU25pJ/webrarian-files-demo
#> ✔ Created _webrarian.yml
#> ✔ Added "_site/" and ".webrarian/" to .gitignore
#> ✔ Cataloged webrarian collection: "webrarian-files-demo"
#>
#> Next steps:
#> Move into the collection: `setwd("/tmp/RtmpQU25pJ/webrarian-files-demo")`
#> Acquire packages: `webrarian::acquire_package("dplyr")`
#> Acquire files: `webrarian::acquire_file("data/")`
#> Bind: `webrarian::bind()`
#> Reading room: `webrarian::reading_room()`
#> ℹ Or pass `path` to each call, e.g. `webrarian::bind(path =
#> "/tmp/RtmpQU25pJ/webrarian-files-demo")`
dir.create(file.path(collection, "data"))
writeLines("x,y\n1,2", file.path(collection, "data", "a.csv"))
acquire_file("data/", path = collection)
#> ✔ Added 1 path: data/
files <- collection_files(collection)
files$files
#> [1] "data/a.csv"
files
#>
#> ── Collection files ────────────────────────────────────────────────────────────
#> Include: "data/"
#> Exclude: "**/*.Rhistory" and "**/.DS_Store"
#> Mount point: /home/web_user
#>
#> ── 1 file bundled ──
#>
#> • data/a.csv
unlink(collection, recursive = TRUE)