Skip to content

Commit

Permalink
[actions] update 17 packages (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Athanasiamo <[email protected]>
  • Loading branch information
carpentries-bot and Athanasiamo authored May 2, 2023
1 parent 2a3b5a3 commit 2df665d
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 57 deletions.
24 changes: 18 additions & 6 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local({

# the requested version of renv
version <- "0.17.2"
version <- "0.17.3"

# the project directory
project <- getwd()
Expand Down Expand Up @@ -63,6 +63,10 @@ local({
if (is.environment(x) || length(x)) x else y
}

`%??%` <- function(x, y) {
if (is.null(x)) y else x
}

bootstrap <- function(version, library) {

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

renv_bootstrap_repos <- function() {

# get CRAN repository
cran <- getOption("renv.repos.cran", "https://cloud.r-project.org")

# check for repos override
repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA)
if (!is.na(repos))
if (!is.na(repos)) {

# check for RSPM; if set, use a fallback repository for renv
rspm <- Sys.getenv("RSPM", unset = NA)
if (identical(rspm, repos))
repos <- c(RSPM = rspm, CRAN = cran)

return(repos)

}

# check for lockfile repositories
repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity)
if (!inherits(repos, "error") && length(repos))
Expand All @@ -104,10 +119,7 @@ local({
repos <- getOption("repos")

# ensure @CRAN@ entries are resolved
repos[repos == "@CRAN@"] <- getOption(
"renv.repos.cran",
"https://cloud.r-project.org"
)
repos[repos == "@CRAN@"] <- cran

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

0 comments on commit 2df665d

Please sign in to comment.