binman_predl_github_assets: binman-like Pre download Github assets

View source: R/binmanHelpers.R

binman_predl_github_assetsR Documentation

binman-like Pre download Github assets

Description

[Stable]

This is a wrapper around binman::predl_github_assets() that adds the parameter dlPath that allows the user to specify the binman download path. This was built to allow custom binman install directories for project specific environments.

Usage

binman_predl_github_assets(
  url,
  platform,
  history = 3L,
  appname,
  platformregex = platform,
  versionregex = c("", ""),
  dlPath = NULL
)

Arguments

url

A url giving the github asset JSON for a project. As an example https://github.com/mozilla/geckodriver/releases the geckodriver project has an asset JSON available at https://api.github.com/repos/mozilla/geckodriver/releases

platform

A character vector of platform names

history

The maximum number of files to get for a platform

appname

Name of the app

platformregex

A filter for platforms. Defaults to the platform

versionregex

A regex for retrieving the version.

dlPath

Custom download path for the binman folder. Defaults to NULL, where it will return the same table as binman::predl_github_assets() with an unmodified download path.

Value

A named list of data.frames. The name indicates the platform. The data.frame should contain the version, url and file to be processed. Used as input for download_files or an equivalent.

Examples

## Not run: 
dllist <- binman_predl_github_assets(
    url = "https://api.github.com/repos/mozilla/geckodriver/releases",
    platform = c("win64"),
    history = 1L,
    appname = "geckodriver",
    versionregex = c("^v", ""),
    dlPath = here::here()
 )
dllist

## End(Not run)

MARC-KC/marcR documentation built on June 2, 2022, 9:31 p.m.