ghc_repos_copy_to: Copy a file or folder

View source: R/commands.R

ghc_repos_copy_toR Documentation

Copy a file or folder

Description

Copy a file or folder to a number of repositories with the same prefix (typically those form the same assignment). Note that this function will overwrite existing files/folders that have the same name. It will also make sure that the copied file/folder is tracked by git (ghc_repos_git_add) unless parameter git_add=FALSE.

Usage

ghc_repos_copy_to(
  prefix,
  from,
  to = basename(from),
  folder = ".",
  git_add = TRUE
)

Arguments

prefix

repository prefix (typically this would be a github classroom assignment prefix)

from

the path to the file (or folder) that is to be copied to the respositories (absolute path or relative to the current working directory)

to

the relative path where in the target repositories the from file/folder should be copied to (default is the same name as the from)

folder

the target directory where to look for matching git repositories (searches recursively in all subdirectories)

git_add

whether to make sure the copied file/folder is tracked by git

Value

returns the prefix invisibly to facilitate piping

See Also

Other command functions: ghc_repos_git_add(), ghc_repos_git_clone(), ghc_repos_git_commit(), ghc_repos_git_create_branch(), ghc_repos_git_delete_branch(), ghc_repos_git_discard_changes(), ghc_repos_git_pull(), ghc_repos_git_push(), ghc_repos_git_remove(), ghc_repos_git_status(), ghc_repos_git_switch_branch(), ghc_repos_run_git_command()


KopfLab/ghctools documentation built on Feb. 20, 2023, 9:25 a.m.