|
2 | 2 | local({ |
3 | 3 |
|
4 | 4 | # 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" |
7 | 7 | attr(version, "sha") <- NULL |
8 | 8 |
|
9 | 9 | # the project directory |
@@ -226,13 +226,17 @@ local({ |
226 | 226 | section <- header(sprintf("Bootstrapping renv %s", friendly)) |
227 | 227 | catf(section) |
228 | 228 |
|
| 229 | + # ensure the target library path exists; required for file.copy(..., recursive = TRUE) |
| 230 | + dir.create(library, showWarnings = FALSE, recursive = TRUE) |
| 231 | + |
229 | 232 | # try to install renv from cache |
230 | 233 | md5 <- attr(version, "md5", exact = TRUE) |
231 | 234 | if (length(md5)) { |
232 | 235 | pkgpath <- renv_bootstrap_find(version) |
233 | 236 | 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()) |
236 | 240 | } |
237 | 241 | } |
238 | 242 |
|
@@ -1231,6 +1235,21 @@ local({ |
1231 | 1235 | } |
1232 | 1236 |
|
1233 | 1237 | 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) { |
1234 | 1253 |
|
1235 | 1254 | # perform bootstrap |
1236 | 1255 | bootstrap(version, libpath) |
|
0 commit comments