diff --git a/renv.lock b/renv.lock index 321885f..48d0972 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.3.2", + "Version": "4.4.0", "Repositories": [ { "Name": "CRAN", @@ -66,23 +66,24 @@ }, "brio": { "Package": "brio", - "Version": "1.1.4", + "Version": "1.1.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "68bd2b066e1fe780bbf62fc8bcc36de3" + "Hash": "c1ee497a6d999947c2c224ae46799b1a" }, "bslib": { "Package": "bslib", - "Version": "0.6.1", + "Version": "0.7.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "base64enc", "cachem", + "fastmap", "grDevices", "htmltools", "jquerylib", @@ -93,42 +94,42 @@ "rlang", "sass" ], - "Hash": "c0d8599494bc7fb408cd206bbdd9cab0" + "Hash": "8644cc53f43828f19133548195d7e59e" }, "cachem": { "Package": "cachem", - "Version": "1.0.8", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "fastmap", "rlang" ], - "Hash": "c35768291560ce302c0a6589f92e837d" + "Hash": "cd9a672193789068eb5a2aad65a0dedf" }, "callr": { "Package": "callr", - "Version": "3.7.3", + "Version": "3.7.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", "processx", "utils" ], - "Hash": "9b2191ede20fa29828139b9900922e51" + "Hash": "d7e13f49c19103ece9e58ad2d83a7354" }, "cli": { "Package": "cli", - "Version": "3.6.2", + "Version": "3.6.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" + "Hash": "b21916dd77a27642b447374a5d30ecf3" }, "clipr": { "Package": "clipr", @@ -159,15 +160,15 @@ }, "crayon": { "Package": "crayon", - "Version": "1.5.2", + "Version": "1.5.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "grDevices", "methods", "utils" ], - "Hash": "e8a1e41acf02548751f45c718d55aa6a" + "Hash": "859d96e65ef198fd43e82b9628d593ef" }, "credentials": { "Package": "credentials", @@ -185,13 +186,13 @@ }, "curl": { "Package": "curl", - "Version": "5.2.0", + "Version": "5.2.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "R" ], - "Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9" + "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" }, "desc": { "Package": "desc", @@ -208,14 +209,14 @@ }, "digest": { "Package": "digest", - "Version": "0.6.34", + "Version": "0.6.36", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "7ede2ee9ea8d3edbf1ca84c1e333ad1a" + "Hash": "fd6824ad91ede64151e93af67df6376b" }, "docopt": { "Package": "docopt", @@ -229,7 +230,7 @@ }, "downlit": { "Package": "downlit", - "Version": "0.4.3", + "Version": "0.4.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -245,7 +246,7 @@ "withr", "yaml" ], - "Hash": "14fa1f248b60ed67e1f5418391a17b14" + "Hash": "45a6a596bf0108ee1ff16a040a2df897" }, "dplyr": { "Package": "dplyr", @@ -270,27 +271,16 @@ ], "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" }, - "ellipsis": { - "Package": "ellipsis", - "Version": "0.3.2", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "rlang" - ], - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" - }, "evaluate": { "Package": "evaluate", - "Version": "0.23", + "Version": "0.24.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "daf4a1246be12c1fa8c7705a0935c1a0" + "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" }, "fansi": { "Package": "fansi", @@ -306,10 +296,10 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.1.1", + "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", - "Hash": "f7736a18de97dea803bde0a2daaafb27" + "Repository": "CRAN", + "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" }, "fontawesome": { "Package": "fontawesome", @@ -325,14 +315,14 @@ }, "fs": { "Package": "fs", - "Version": "1.6.3", + "Version": "1.6.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "47b5f30c720c23999b913a1a635cf0bb" + "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" }, "generics": { "Package": "generics", @@ -362,19 +352,21 @@ }, "gh": { "Package": "gh", - "Version": "1.4.0", + "Version": "1.4.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", "gitcreds", + "glue", "httr2", "ini", "jsonlite", + "lifecycle", "rlang" ], - "Hash": "03533b1c875028233598f848fda44c4c" + "Hash": "fbbbc48eba7a6626a08bb365e44b563b" }, "gitcreds": { "Package": "gitcreds", @@ -409,35 +401,34 @@ }, "highr": { "Package": "highr", - "Version": "0.10", + "Version": "0.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "xfun" ], - "Hash": "06230136b2d2b9ba5805e1963fa6e890" + "Hash": "d65ba49117ca223614f71b60d85b8ab7" }, "htmltools": { "Package": "htmltools", - "Version": "0.5.7", + "Version": "0.5.8.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "base64enc", "digest", - "ellipsis", "fastmap", "grDevices", "rlang", "utils" ], - "Hash": "2d7b3857980e0e0d0a1fd6f11928ab0f" + "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" }, "httpuv": { "Package": "httpuv", - "Version": "1.6.14", + "Version": "1.6.15", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -448,26 +439,11 @@ "promises", "utils" ], - "Hash": "16abeb167dbf511f8cc0552efaf05bab" - }, - "httr": { - "Package": "httr", - "Version": "1.4.7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "curl", - "jsonlite", - "mime", - "openssl" - ], - "Hash": "ac107251d9d9fd72f0ca8049988f1d7f" + "Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0" }, "httr2": { "Package": "httr2", - "Version": "1.0.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -484,7 +460,7 @@ "vctrs", "withr" ], - "Hash": "e2b30f1fc039a0bab047dd52bb20ef71" + "Hash": "03d741c92fda96d98c3a3f22494e3b4a" }, "ini": { "Package": "ini", @@ -515,9 +491,9 @@ }, "knitr": { "Package": "knitr", - "Version": "1.45", + "Version": "1.48", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "evaluate", @@ -527,7 +503,7 @@ "xfun", "yaml" ], - "Hash": "1ec462871063897135c1bcbe0fc8f07d" + "Hash": "acf380f300c721da9fde7df115a5f86f" }, "later": { "Package": "later", @@ -586,13 +562,13 @@ }, "openssl": { "Package": "openssl", - "Version": "2.1.1", + "Version": "2.2.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "askpass" ], - "Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5" + "Hash": "2bcca3848e4734eb3b16103bc9aa4b8e" }, "pandoc": { "Package": "pandoc", @@ -609,14 +585,14 @@ }, "pegboard": { "Package": "pegboard", - "Version": "0.7.3", + "Version": "0.7.6", "Source": "GitHub", "RemoteType": "github", + "RemoteHost": "api.github.com", "RemoteUsername": "carpentries", "RemoteRepo": "pegboard", "RemoteRef": "main", - "RemoteSha": "1bc5753e917d515c3d888ce6cc013c0a680eacfc", - "RemoteHost": "api.github.com", + "RemoteSha": "ad2542f7f7b9c3f90cc871b355ff81ec14a09ca9", "Remotes": "ropensci/tinkr", "Requirements": [ "R6", @@ -629,7 +605,7 @@ "xslt", "yaml" ], - "Hash": "395e98c781a3e7467612a10b757ba325" + "Hash": "896ea59e2b5ee99645de126b99be5f6e" }, "pillar": { "Package": "pillar", @@ -660,9 +636,9 @@ }, "pkgdown": { "Package": "pkgdown", - "Version": "2.0.7", + "Version": "2.1.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "bslib", @@ -671,11 +647,11 @@ "desc", "digest", "downlit", + "fontawesome", "fs", - "httr", + "httr2", "jsonlite", - "magrittr", - "memoise", + "openssl", "purrr", "ragg", "rlang", @@ -686,11 +662,11 @@ "xml2", "yaml" ], - "Hash": "16fa15449c930bf3a7761d3c68f8abf9" + "Hash": "0d3d789055c873f48521ce7e23c23f48" }, "processx": { "Package": "processx", - "Version": "3.8.3", + "Version": "3.8.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -699,11 +675,11 @@ "ps", "utils" ], - "Hash": "82d48b1aec56084d9438dbf98087a7e9" + "Hash": "0c90a7d71988856bad2a2a45dd871bb9" }, "promises": { "Package": "promises", - "Version": "1.2.1", + "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -715,18 +691,18 @@ "rlang", "stats" ], - "Hash": "0d8a15c9d000970ada1ab21405387dee" + "Hash": "434cd5388a3979e74be5c219bcd6e77d" }, "ps": { "Package": "ps", - "Version": "1.7.6", + "Version": "1.7.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "dd2b9319ee0656c8acf45c7f40c59de7" + "Hash": "878b467580097e9c383acbb16adab57a" }, "purrr": { "Package": "purrr", @@ -745,14 +721,14 @@ }, "ragg": { "Package": "ragg", - "Version": "1.2.7", + "Version": "1.3.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "systemfonts", "textshaping" ], - "Hash": "90a1b8b7e518d7f90480d56453b4d062" + "Hash": "e3087db406e079a8a2fd87f413918ed3" }, "rappdirs": { "Package": "rappdirs", @@ -766,28 +742,28 @@ }, "renv": { "Package": "renv", - "Version": "1.0.3", + "Version": "1.0.7", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "41b847654f567341725473431dd0d5ab" + "Hash": "397b7b2a265bc5a7a06852524dabae20" }, "rlang": { "Package": "rlang", - "Version": "1.1.3", + "Version": "1.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" + "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.25", + "Version": "2.27", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -800,14 +776,13 @@ "jsonlite", "knitr", "methods", - "stringr", "tinytex", "tools", "utils", "xfun", "yaml" ], - "Hash": "d65e35823c817f09f4de424fcdfa812a" + "Hash": "27f9502e1cdbfa195f94e03b0f517484" }, "rprojroot": { "Package": "rprojroot", @@ -821,22 +796,16 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.15.0", + "Version": "0.16.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "5564500e25cffad9e22244ced1379887" + "Hash": "96710351d642b70e8f02ddeb237c46a7" }, "sandpaper": { "Package": "sandpaper", - "Version": "0.16.2", - "Source": "GitHub", - "RemoteType": "github", - "RemoteUsername": "carpentries", - "RemoteRepo": "sandpaper", - "RemoteRef": "main", - "RemoteSha": "eb009faca249bac5b999ac5449990329d3eb7d0d", - "RemoteHost": "api.github.com", - "Remotes": "carpentries/pegboard, carpentries/varnish", + "Version": "0.16.5", + "Source": "Repository", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "assertthat", "callr", @@ -863,11 +832,11 @@ "withr", "yaml" ], - "Hash": "543b46b87697df796798eeb291e72e7f" + "Hash": "4a578040d41e402165b093cc4ab1b6c7" }, "sass": { "Package": "sass", - "Version": "0.4.8", + "Version": "0.4.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -877,11 +846,11 @@ "rappdirs", "rlang" ], - "Hash": "168f9353c76d4c4b0a0bbf72e2c2d035" + "Hash": "d53dbfddf695303ea4ad66f86e99b95d" }, "servr": { "Package": "servr", - "Version": "0.29", + "Version": "0.30", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -891,37 +860,7 @@ "mime", "xfun" ], - "Hash": "d8a65e80fdc852bd6a0635664260a6e3" - }, - "stringi": { - "Package": "stringi", - "Version": "1.8.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats", - "tools", - "utils" - ], - "Hash": "058aebddea264f4c99401515182e656a" - }, - "stringr": { - "Package": "stringr", - "Version": "1.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "magrittr", - "rlang", - "stringi", - "vctrs" - ], - "Hash": "960e2ae9e09656611e0b8214ad543207" + "Hash": "562294886e51319dfad3f3e6e61fb0b8" }, "sys": { "Package": "sys", @@ -932,26 +871,28 @@ }, "systemfonts": { "Package": "systemfonts", - "Version": "1.0.5", + "Version": "1.1.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "R", - "cpp11" + "cpp11", + "lifecycle" ], - "Hash": "15b594369e70b975ba9f064295983499" + "Hash": "213b6b8ed5afbf934843e6c3b090d418" }, "textshaping": { "Package": "textshaping", - "Version": "0.3.7", + "Version": "0.4.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "R", "cpp11", + "lifecycle", "systemfonts" ], - "Hash": "997aac9ad649e0ef3b97f96cddd5622b" + "Hash": "5142f8bc78ed3d819d26461b641627ce" }, "tibble": { "Package": "tibble", @@ -974,9 +915,9 @@ }, "tidyselect": { "Package": "tidyselect", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -986,43 +927,44 @@ "vctrs", "withr" ], - "Hash": "79540e5fcd9e0435af547d885f184fd5" + "Hash": "829f27b9c4919c16b593794a6344d6c0" }, "tinkr": { "Package": "tinkr", - "Version": "0.2.0", + "Version": "0.2.0.9000", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "ropensci", "RemoteRepo": "tinkr", "RemoteRef": "main", - "RemoteSha": "a5dd3ddfa235d4a3eb6df78c885d68410ba161c8", + "RemoteSha": "8a57235f7072dbcb7eb22516290c58b692a9c015", "Requirements": [ "R6", "commonmark", "glue", "magrittr", "purrr", + "rlang", "xml2", "xslt", "yaml" ], - "Hash": "1dff5f878bfb560fdfe0db0547f75a1d" + "Hash": "a46321228fc84a3e633ee96e5b7fcc57" }, "tinytex": { "Package": "tinytex", - "Version": "0.49", + "Version": "0.51", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "5ac22900ae0f386e54f1c307eca7d843" + "Hash": "d44e2fcd2e4e076f0aac540208559d1d" }, "usethis": { "Package": "usethis", - "Version": "2.2.2", + "Version": "2.2.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1049,7 +991,7 @@ "withr", "yaml" ], - "Hash": "60e51f0b94d0324dc19e44110098fa9f" + "Hash": "d524fd42c517035027f866064417d7e6" }, "utf8": { "Package": "utf8", @@ -1063,15 +1005,15 @@ }, "varnish": { "Package": "varnish", - "Version": "1.0.1.9000", + "Version": "1.0.3", "Source": "GitHub", "RemoteType": "github", + "RemoteHost": "api.github.com", "RemoteUsername": "carpentries", "RemoteRepo": "varnish", "RemoteRef": "main", - "RemoteSha": "1a863b61af402d1d244833e7dccb67894067b0e3", - "RemoteHost": "api.github.com", - "Hash": "b571def8a46883bb4a679f87a22b77b9" + "RemoteSha": "1f1e219d53c8ac42d5f2864cf2ecaf3f84ff4c0c", + "Hash": "742bcf8f71c662cac6cecb1e5d62b3f5" }, "vctrs": { "Package": "vctrs", @@ -1108,7 +1050,7 @@ }, "xfun": { "Package": "xfun", - "Version": "0.42", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1116,13 +1058,13 @@ "stats", "tools" ], - "Hash": "fd1349170df31f7a10bd98b0189e85af" + "Hash": "ca59c87fe305b16a9141a5874c3a7889" }, "xml2": { "Package": "xml2", "Version": "1.3.6", "Source": "Repository", - "Repository": "CRAN", + "Repository": "https://carpentries.r-universe.dev", "Requirements": [ "R", "cli", @@ -1133,21 +1075,21 @@ }, "xslt": { "Package": "xslt", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "Rcpp", "xml2" ], - "Hash": "e2c9cc5c470a5a3a4c1d458404f1a034" + "Hash": "1ff6a2b18d8937ec8f39bb7c9385d2b8" }, "yaml": { "Package": "yaml", - "Version": "2.3.8", + "Version": "2.3.9", "Source": "Repository", "Repository": "CRAN", - "Hash": "29240487a071f535f5e5d5a323b7afbd" + "Hash": "9cb28d11799d93c953f852083d55ee9e" }, "zip": { "Package": "zip", diff --git a/renv/activate.R b/renv/activate.R index cb5401f..d13f993 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,11 +2,13 @@ local({ # the requested version of renv - version <- "1.0.3" + version <- "1.0.7" attr(version, "sha") <- NULL # the project directory - project <- getwd() + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() # use start-up diagnostics if enabled diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") @@ -31,6 +33,14 @@ local({ if (!is.null(override)) return(override) + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + # next, check environment variables # TODO: prefer using the configuration one in the future envvars <- c( @@ -50,9 +60,22 @@ local({ }) - if (!enabled) + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + return(FALSE) + } + # avoid recursion if (identical(getOption("renv.autoloader.running"), TRUE)) { warning("ignoring recursive attempt to run renv autoloader") @@ -108,6 +131,21 @@ local({ } + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + paste(substring(lines, common), collapse = "\n") + + } + startswith <- function(string, prefix) { substring(string, 1, nchar(prefix)) == prefix } @@ -610,6 +648,9 @@ local({ # if the user has requested an automatic prefix, generate it auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + if (auto %in% c("TRUE", "True", "true", "1")) return(renv_bootstrap_platform_prefix_auto()) @@ -801,24 +842,23 @@ local({ # the loaded version of renv doesn't match the requested version; # give the user instructions on how to proceed - remote <- if (!is.null(description[["RemoteSha"]])) { + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) paste("rstudio/renv", description[["RemoteSha"]], sep = "@") - } else { + else paste("renv", description[["Version"]], sep = "@") - } # display both loaded version + sha if available friendly <- renv_bootstrap_version_friendly( version = description[["Version"]], - sha = description[["RemoteSha"]] + sha = if (dev) description[["RemoteSha"]] ) - fmt <- paste( - "renv %1$s was loaded from project library, but this project is configured to use renv %2$s.", - "- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", - "- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", - sep = "\n" - ) + fmt <- heredoc(" + renv %1$s was loaded from project library, but this project is configured to use renv %2$s. + - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. + - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. + ") catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) FALSE @@ -1041,7 +1081,7 @@ local({ # if jsonlite is loaded, use that instead if ("jsonlite" %in% loadedNamespaces()) { - json <- catch(renv_json_read_jsonlite(file, text)) + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1050,7 +1090,7 @@ local({ } # otherwise, fall back to the default JSON reader - json <- catch(renv_json_read_default(file, text)) + json <- tryCatch(renv_json_read_default(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1063,14 +1103,14 @@ local({ } renv_json_read_jsonlite <- function(file = NULL, text = NULL) { - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") jsonlite::fromJSON(txt = text, simplifyVector = FALSE) } renv_json_read_default <- function(file = NULL, text = NULL) { # find strings in the JSON - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' locs <- gregexpr(pattern, text, perl = TRUE)[[1]] @@ -1118,14 +1158,14 @@ local({ map <- as.list(map) # remap strings in object - remapped <- renv_json_remap(json, map) + remapped <- renv_json_read_remap(json, map) # evaluate eval(remapped, envir = baseenv()) } - renv_json_remap <- function(json, map) { + renv_json_read_remap <- function(json, map) { # fix names if (!is.null(names(json))) { @@ -1152,7 +1192,7 @@ local({ # recurse if (is.recursive(json)) { for (i in seq_along(json)) { - json[i] <- list(renv_json_remap(json[[i]], map)) + json[i] <- list(renv_json_read_remap(json[[i]], map)) } }