Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export(CMD_Render)
export(CMD_Rscript)
export(Cmd)
export(Comment)
export(Copy)
export(Entrypoint)
export(Expose)
export(Label)
Expand Down
2 changes: 2 additions & 0 deletions R/Class-Copy.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' @family instruction classes
#' @examples
#' #no example yet
#' Copy("here", "/here")
setClass("Copy",
slots = list(src = "character", dest = "character"),
contains = "Instruction")
Expand All @@ -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) {
Expand Down
9 changes: 8 additions & 1 deletion R/utility-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions man/Copy-class.Rd

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