check_git_repo {githubr} | R Documentation |
Check if a repository exists on GitHub
Description
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
## Not run:
exists <- check_git_repo("jhudsl/OTTR_Template")
if (exists) message("Yup, this repo exists")
## End(Not run)
[Package githubr version 0.9.1 Index]