Skip to content

Commit 25c7bfd

Browse files
Bisaloogithub-actions[bot]
authored andcommitted
[actions] update 23 packages
1 parent a87b094 commit 25c7bfd

2 files changed

Lines changed: 77 additions & 52 deletions

File tree

renv/activate.R

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
local({
33

44
# the requested version of renv
5-
version <- "1.1.7"
6-
attr(version, "md5") <- "dd5d60f155dadff4c88c2fc6680504b4"
5+
version <- "1.2.0"
6+
attr(version, "md5") <- "b7d230b07507f361d3bcf794d157a188"
77
attr(version, "sha") <- NULL
88

99
# the project directory
@@ -226,13 +226,17 @@ local({
226226
section <- header(sprintf("Bootstrapping renv %s", friendly))
227227
catf(section)
228228

229+
# ensure the target library path exists; required for file.copy(..., recursive = TRUE)
230+
dir.create(library, showWarnings = FALSE, recursive = TRUE)
231+
229232
# try to install renv from cache
230233
md5 <- attr(version, "md5", exact = TRUE)
231234
if (length(md5)) {
232235
pkgpath <- renv_bootstrap_find(version)
233236
if (length(pkgpath) && file.exists(pkgpath)) {
234-
file.copy(pkgpath, library, recursive = TRUE)
235-
return(invisible())
237+
ok <- file.copy(pkgpath, library, recursive = TRUE)
238+
if (isTRUE(ok))
239+
return(invisible())
236240
}
237241
}
238242

@@ -1231,6 +1235,21 @@ local({
12311235
}
12321236

12331237
renv_bootstrap_run <- function(project, libpath, version) {
1238+
tryCatch(
1239+
renv_bootstrap_run_impl(project, libpath, version),
1240+
error = function(e) {
1241+
msg <- paste(
1242+
"failed to bootstrap renv: the project will not be loaded.",
1243+
paste("Reason:", conditionMessage(e)),
1244+
"Use `renv::activate()` to re-initialize the project.",
1245+
sep = "\n"
1246+
)
1247+
warning(msg, call. = FALSE)
1248+
}
1249+
)
1250+
}
1251+
1252+
renv_bootstrap_run_impl <- function(project, libpath, version) {
12341253

12351254
# perform bootstrap
12361255
bootstrap(version, libpath)

0 commit comments

Comments
 (0)