2
2
local({
3
3
4
4
# the requested version of renv
5
- version <- " 0.17.2 "
5
+ version <- " 0.17.3 "
6
6
7
7
# the project directory
8
8
project <- getwd()
@@ -63,6 +63,10 @@ local({
63
63
if (is.environment(x ) || length(x )) x else y
64
64
}
65
65
66
+ `%??%` <- function (x , y ) {
67
+ if (is.null(x )) y else x
68
+ }
69
+
66
70
bootstrap <- function (version , library ) {
67
71
68
72
# attempt to download renv
@@ -83,11 +87,22 @@ local({
83
87
84
88
renv_bootstrap_repos <- function () {
85
89
90
+ # get CRAN repository
91
+ cran <- getOption(" renv.repos.cran" , " https://cloud.r-project.org" )
92
+
86
93
# check for repos override
87
94
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
+
89
102
return (repos )
90
103
104
+ }
105
+
91
106
# check for lockfile repositories
92
107
repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity )
93
108
if (! inherits(repos , " error" ) && length(repos ))
@@ -104,10 +119,7 @@ local({
104
119
repos <- getOption(" repos" )
105
120
106
121
# 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
111
123
112
124
# add in renv.bootstrap.repos if set
113
125
default <- c(FALLBACK = " https://cloud.r-project.org" )
0 commit comments