Skip to content

Commit d793517

Browse files
authored
[actions] update 29 packages
1 parent 524bd6a commit d793517

File tree

2 files changed

+90
-78
lines changed

2 files changed

+90
-78
lines changed

renv/activate.R

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
local({
33

44
# the requested version of renv
5-
version <- "0.17.2"
5+
version <- "0.17.3"
66

77
# the project directory
88
project <- getwd()
@@ -63,6 +63,10 @@ local({
6363
if (is.environment(x) || length(x)) x else y
6464
}
6565

66+
`%??%` <- function(x, y) {
67+
if (is.null(x)) y else x
68+
}
69+
6670
bootstrap <- function(version, library) {
6771

6872
# attempt to download renv
@@ -83,11 +87,22 @@ local({
8387

8488
renv_bootstrap_repos <- function() {
8589

90+
# get CRAN repository
91+
cran <- getOption("renv.repos.cran", "https://cloud.r-project.org")
92+
8693
# check for repos override
8794
repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA)
88-
if (!is.na(repos))
95+
if (!is.na(repos)) {
96+
97+
# check for RSPM; if set, use a fallback repository for renv
98+
rspm <- Sys.getenv("RSPM", unset = NA)
99+
if (identical(rspm, repos))
100+
repos <- c(RSPM = rspm, CRAN = cran)
101+
89102
return(repos)
90103

104+
}
105+
91106
# check for lockfile repositories
92107
repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity)
93108
if (!inherits(repos, "error") && length(repos))
@@ -104,10 +119,7 @@ local({
104119
repos <- getOption("repos")
105120

106121
# ensure @CRAN@ entries are resolved
107-
repos[repos == "@CRAN@"] <- getOption(
108-
"renv.repos.cran",
109-
"https://cloud.r-project.org"
110-
)
122+
repos[repos == "@CRAN@"] <- cran
111123

112124
# add in renv.bootstrap.repos if set
113125
default <- c(FALLBACK = "https://cloud.r-project.org")

0 commit comments

Comments
 (0)