Skip to content

Commit

Permalink
Add ... to allow flag passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
xuf12 committed Jan 30, 2025
1 parent eb00043 commit 3302e14
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
31 changes: 17 additions & 14 deletions R/release.R
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
#' create a cranlike repo that contains the tagged package
#' @param .dir directory to create the repo in
#' @param repo_name repository name to specify in the description
#' @param ... additional arguments passed to build_pkg
#' @export
create_tagged_repo <- function(.dir, repo_name = "pkgpub") {
create_tagged_repo <- function(.dir, repo_name = "pkgpub", ...) {
ctag <- current_commit_tag()

# not tagged
if (is.null(ctag)) {
stop("current commit is not tagged")
stop("current commit is not tagged")
}
desc <- as.data.frame(read.dcf("DESCRIPTION",fields = "Version"))
desc <- as.data.frame(read.dcf("DESCRIPTION", fields = "Version"))
if (desc$Version != ctag) {
stop(sprintf("mismatch between git tag (%s) and DESCRIPTION Version (%s)", ctag, desc$Version), call. = FALSE)
}

repo_dir <- new_cranlike_repo(file.path(.dir, ctag))

built_dir <- build_pkg(.pkgdir = ".",
types = "source",
origin = sanitize_git_url(git_url()),
repository = repo_name,
addl_meta = list(git_tag = ctag, git_commit = gert::git_info()$commit),
supplement_version = FALSE
)


built_dir <- build_pkg(
.pkgdir = ".",
types = "source",
origin = sanitize_git_url(git_url()),
repository = repo_name,
addl_meta = list(git_tag = ctag, git_commit = gert::git_info()$commit),
supplement_version = FALSE,
...
)

res <- insert_packages(unlist(built_dir), repo_dir)
if (!isTRUE(res)) {
rlang::abort("failure building or inserting package")
Expand Down
4 changes: 3 additions & 1 deletion man/create_tagged_repo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3302e14

Please sign in to comment.