getGithubFile: A simple way to get a Github file, authenticated

View source: R/getModule.R

getGithubFileR Documentation

A simple way to get a Github file, authenticated

Description

This can be used within e.g., the options or params arguments for setupProject to get a ready-made file for a project.

Usage

getGithubFile(
  gitRepoFile,
  overwrite = FALSE,
  destDir = ".",
  verbose = getOption("Require.verbose")
)

Arguments

gitRepoFile

Character string that follows the convention GitAccount/GitRepo@Branch/File, if @Branch is omitted, then it will be assumed to be master or main.

overwrite

A logical vector of same length (or length 1) gitRepo. If TRUE, then the download will delete any existing folder with the same name as the repository provided in gitRepo

destDir

A directory to put the file that is to be downloaded.

verbose

Numeric or logical indicating how verbose should the function be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE, then minimal outputs; if 1 or TRUE, more outputs; 2 even more. NOTE: in Require function, when verbose >= 2, also returns details as if returnDetails = TRUE (for backwards compatibility).

See Also

getModule

Examples

filename <- getGithubFile("PredictiveEcology/LandWeb@development/01b-options.R",
                          destDir = Require::tempdir2())

PredictiveEcology/SpaDES.project documentation built on Dec. 23, 2024, 7:33 a.m.