diff --git a/NAMESPACE b/NAMESPACE index 38e1aa3..ae356e5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,6 +7,7 @@ export(CMD_Render) export(CMD_Rscript) export(Cmd) export(Comment) +export(Copy) export(Entrypoint) export(Expose) export(Label) diff --git a/R/Class-Copy.R b/R/Class-Copy.R index 29f8d25..c3c6a86 100644 --- a/R/Class-Copy.R +++ b/R/Class-Copy.R @@ -13,6 +13,7 @@ #' @family instruction classes #' @examples #' #no example yet +#' Copy("here", "/here") setClass("Copy", slots = list(src = "character", dest = "character"), contains = "Instruction") @@ -26,6 +27,7 @@ setClass("Copy", #' @param addTrailingSlashes (boolean) add trailing slashes to the given paths if the source is an existing directory #' #' @return the object +#' @export #' @importFrom fs dir_exists #' @importFrom stringr str_detect Copy <- function(src, dest, addTrailingSlashes = TRUE) { diff --git a/R/utility-functions.R b/R/utility-functions.R index dcf7d04..a063e08 100644 --- a/R/utility-functions.R +++ b/R/utility-functions.R @@ -190,10 +190,17 @@ getRVersionTag <- function(from, default = paste(R.Version()$major, R.Version()$ } else if (inherits(from, "description")) { # get R: stringr::str_extract(string = "methods, R (1.2.3,test), test (9.9)", pattern = "R( \\(.*?\\))?") # get version: stringr::str_extract(string = "R (1.2.3)", pattern = "(?<=\\().+?(?=\\))") - r_depends <- stringr::str_extract(string = from$get_field("Depends"), pattern = "R( \\(.*?\\))?") + r_depends <- stringr::str_extract(string = from$get_field("Depends", default = NULL), pattern = "R( \\(.*?\\))?") r_version <- stringr::str_extract(string = stringr::str_extract(string = r_depends, pattern = "(?<=\\().+?(?=\\))"), pattern = "(\\d).*") # everything after the first digit + if (length(r_version) == 0 || nchar(n_version) == 0) { + warning(paste0("No R version in DESCRIPTION file, using sessionInfo(). ", + "Set Depends: R (>= VERSION) to override")) + temp_from <- sessionInfo() + r_version <- paste(temp_from$R.version$major, temp_from$R.version$minor, sep = ".") + futile.logger::flog.debug("Got R version from sessionInfo: %s", r_version) + } } else if (!is.null(from) && !is.expression(from) && !is.na(from) diff --git a/man/Copy-class.Rd b/man/Copy-class.Rd index 7772447..ebd235c 100644 --- a/man/Copy-class.Rd +++ b/man/Copy-class.Rd @@ -17,6 +17,7 @@ S4 Class representing a COPY-instruction } \examples{ #no example yet +Copy("here", "/here") } \seealso{ Other instruction classes: