~enricoschumann/esutils

1e9d69aac102edd719e5d1b854c31a0349b731da — Enrico Schumann 2 years ago 80c6b5e
Prepare version 0.3.2

* R/repos.R (git_bundle_pull, git_bundle_clone):
allow arguments to be passed to system2
3 files changed, 14 insertions(+), 7 deletions(-)

M ChangeLog
M DESCRIPTION
M R/repos.R
M ChangeLog => ChangeLog +7 -0
@@ 1,3 1,10 @@
2022-09-22  Enrico Schumann  <es@enricoschumann.net>

        * DESCRIPTION (Version): 0.3.2

        * R/repos.R (git_bundle_pull, git_bundle_clone):
        allow arguments to be passed to system2

2022-09-06  Enrico Schumann  <es@enricoschumann.net>

        * DESCRIPTION (Version): 0.3.1

M DESCRIPTION => DESCRIPTION +2 -2
@@ 1,8 1,8 @@
Package: esutils
Type: Package
Title: esutils
Version: 0.3.1
Date: 2022-09-06
Version: 0.3.2
Date: 2022-09-22
Maintainer: Enrico Schumann <es@enricoschumann.net>
Authors@R: person(given = "Enrico", family = "Schumann",
                  role  = c("aut", "cre"),

M R/repos.R => R/repos.R +5 -5
@@ 98,7 98,7 @@ git_bundle_create <- function(repos, output.filenames,
    invisible(NULL)
}

git_bundle_pull <- function(bundle, target, branch = "master") {
git_bundle_pull <- function(bundle, target, branch = "master", ...) {

    if (!dir.exists(target))
        stop("'target' does not exist. Maybe clone?")


@@ 107,18 107,18 @@ git_bundle_pull <- function(bundle, target, branch = "master") {
    on.exit(setwd(current.dir))

    setwd(target)
    system2("git", c("pull", bundle, branch))
    system2("git", c("pull", bundle, branch), ...)
}

git_bundle_clone <- function(bundle, dir.name, parent.dir) {
git_bundle_clone <- function(bundle, dir.name, parent.dir, ...) {

    if (dir.exists(file.path(parent.dir, dir.name)))
        stop("'dir.name' already exists. Maybe pull?")
        stop("directory ", sQuote(dir.name), " already exists. Maybe pull?")

    current.dir <- getwd()
    on.exit(setwd(current.dir))

    setwd(parent.dir)
    system2("git", c("clone", "-b", "master", bundle, dir.name))
    system2("git", c("clone", "-b", "master", bundle, dir.name), ...)
}