pb_download_url: Get the download url of a given file

Description Usage Arguments Value Examples

View source: R/pb_download_url.R

Description

Returns the URL download for a public file. This can be useful when writing scripts that may want to download the file directly without introducing any dependency on piggyback or authentication steps.

Usage

1
2
3
4
5
6
pb_download_url(
  file = NULL,
  repo = guess_repo(),
  tag = "latest",
  .token = get_token()
)

Arguments

file

name or vector of names of files to be downloaded. If NULL, all assets attached to the release will be downloaded.

repo

Repository name in format "owner/repo". Will guess the current repo if not specified.

tag

tag for the GitHub release to which this data is attached

.token

GitHub authentication token. Typically set from an environmental variable, e.g. in a .Renviron file or with Sys.setenv(GITHUB_TOKEN = "xxxxx"), which helps prevent accidental disclosure of a secret token when sharing scripts.

Value

the URL to download a file

Examples

1
2
3
pb_download_url("data/iris.tsv.xz",
                repo = "cboettig/piggyback-tests",
                tag = "v0.0.1")

piggyback documentation built on Feb. 25, 2020, 5:08 p.m.