Skip to content

Commit

Permalink
set CRAN url if default is "@cran@"
Browse files Browse the repository at this point in the history
This will fix #526
  • Loading branch information
zkamvar authored and fmichonneau committed Dec 3, 2020
1 parent c4b6e23 commit ca16e0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ install_required_packages <- function(lib = NULL, repos = getOption("repos", def
c("rprojroot", "desc", "remotes", "renv"),
rownames(installed.packages(lib.loc = lib))
)
# The default installation of R will have "@CRAN@" as the default repository, which directs contrib.url() to either
# force the user to choose a mirror if interactive or fail if not. Since we are not interactve, we need to force the
# mirror here.
if ("@CRAN@" %in% repos) {
repos <- c(CRAN = "https://cran.rstudio.com/")
}

install.packages(missing_pkgs, lib = lib, repos = repos)

Expand Down

0 comments on commit ca16e0b

Please sign in to comment.