Given a repository name, check with git ls-remote whether the repository exists and return a TRUE/FALSE

Usage,
check_git_repo(
  repo_name,
  git_pat = NULL,
  silent = TRUE,
  return_repo = FALSE,
  verbose = TRUE
)

Arguments

repo_name

the name of the repository, e.g. jhudsl/OTTR_Template

git_pat

A personal access token from GitHub. Only necessary if the repository being checked is a private repository.

silent

TRUE/FALSE of whether the warning from the git ls-remote command should be echoed back if it does fail.

return_repo

TRUE/FALSE of whether or not the output from git ls-remote should be saved to a file (if the repo exists)

verbose

TRUE/FALSE do you want more progress messages?

Value

A TRUE/FALSE whether or not the repository exists. Optionally the output from git ls-remote if return_repo = TRUE.

Examples


check_git_repo("jhudsl/OTTR_Template")
#> Checking for remote git repository: jhudsl/OTTR_Template
#> Error in throw(new_error("gitcreds_no_credentials", url = url)): Could not find any credentials