feat: allow subsetting to latest package tag
This commit is contained in:
parent
2f24172333
commit
8b96211df0
1 changed files with 5 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
|
||||
gert::git_config_global_set("advice.detachedHead", "false")
|
||||
|
||||
if (is.null(tag)) {
|
||||
if (tag == "latest" || is.null(tag)) {
|
||||
gert::git_clone(sprintf("https://github.com/cran/%s", package_name),
|
||||
path = sprintf("%s/%s", tempdir(), "tmp1"),
|
||||
verbose = FALSE
|
||||
|
|
@ -84,6 +84,10 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
|
||||
unlink(sprintf("%s/%s", tempdir(), "tmp1"), force = TRUE, recursive = TRUE)
|
||||
tag <- all_tags$name
|
||||
# gert cannot sort by date (which is a problem for properly sorting tags like 1.0-10 and others)
|
||||
if (tag == "latest") {
|
||||
system("git tag --sort=-creatordate | head -1")
|
||||
}
|
||||
package_name <- rep(package_name, length(tag))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue