repo_core {ghclass}R Documentation

GitHub Repository tools - core functions

Description

Usage

repo_create(
  org,
  name,
  prefix = "",
  suffix = "",
  private = TRUE,
  auto_init = FALSE,
  gitignore_template = "R"
)

repo_delete(repo, prompt = TRUE)

repo_exists(repo, strict = FALSE, quiet = FALSE)

repo_is_template(repo)

repo_mirror(
  source_repo,
  target_repo,
  overwrite = FALSE,
  verbose = FALSE,
  warn = TRUE
)

repo_mirror_template(source_repo, target_repo, private = TRUE)

repo_rename(repo, new_repo)

repo_set_template(repo, status = TRUE)

Arguments

org

Character. GitHub organization that will own the repository

name

Character. Repository name

prefix

Character. Common repository name prefix

suffix

Character. Common repository name suffix

private

Logical. Should the new repository be private or public.

auto_init

Logical. Should the repository be initialized with a README.md.

gitignore_template

Character. .gitignore language template to use.

repo

Character. Address of repository in owner/repo format.

prompt

Logical. Should the user be prompted before deleting repositories. Default true.

strict

Logical. Should the old name of a renamed repositories be allowed.

quiet

Logical. Should details on renamed repositories be printed.

source_repo

Character. Address of template repository in owner/name format.

target_repo

Character. One or more repository addresses in owner/name format. Note when using template repos these new repositories must not exist.

overwrite

Logical. Should the target repositories be overwritten.

verbose

Logical. Display verbose output.

warn

Logical. Warn the user about the function being deprecated.

new_repo

Character. New name of repository without the owner.

status

Logical. Should the repository be set as a template repository

Value

repo_create() returns a character vector of created repos (in owner/repo format)

repo_exists() and repo_is_template() both return a logical vector.

All other functions invisibly return a list containing the results of the relevant GitHub API calls.

Examples

## Not run: 
repo_create("ghclass-test", "repo_test")

repo_exists("ghclass-test/repo_test")

repo_rename("ghclass-test/repo_test", "repo_test_new")


# The new repo exists
repo_exists("ghclass-test/repo_test_new")

# The old repo forwards to the new repo
repo_exists("ghclass-test/repo_test")


# Check for the redirect by setting `strict = TRUE`
repo_exists("ghclass-test/repo_test", strict = TRUE)


# The prefered way of copying a repo is by making the source a template
repo_is_template("ghclass-test/repo_test_new")

repo_set_template("ghclass-test/repo_test_new")

repo_is_template("ghclass-test/repo_test_new")


# Given a template repo we can then directly copy the repo on GitHub
repo_mirror_template("ghclass-test/repo_test_new", "ghclass-test/repo_test_copy")

repo_exists("ghclass-test/repo_test_copy")

# Cleanup
repo_delete(
 c("ghclass-test/repo_test_new",
   "ghclass-test/repo_test_copy"),
 prompt = FALSE
)


## End(Not run)



[Package ghclass version 0.3.0 Index]