Skip to content

Commit

Permalink
Support CRAN_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 11, 2025
1 parent 38a7a3e commit 7644315
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ local({
}

# NB: pak also adds cran and bioconductor automatically when not set already
repos <- c(
BIOC = binary_universe("https://bioc.r-universe.dev"),
PPM = sprintf("https://packagemanager.posit.co/cran/__linux__/%s/latest", distro),
CRAN = 'https://cloud.r-project.org'
)
cran_version <- Sys.getenv("CRAN_VERSION")
if(nchar(cran_version)){
repos <- c(
CRAN = sprintf("https://p3m.dev/cran/__linux__/%s/%s", distro, cran_version),
BIOC = binary_universe("https://bioc.r-universe.dev")
)
} else {
repos <- c(
BIOC = binary_universe("https://bioc.r-universe.dev"),
PPM = sprintf("https://packagemanager.posit.co/cran/__linux__/%s/latest", distro),
CRAN = 'https://cloud.r-project.org'
)
}

if(nchar(Sys.getenv("MY_UNIVERSE"))){
repos <- c(MY_UNIVERSE = binary_universe(Sys.getenv("MY_UNIVERSE")), repos)
}
Expand Down

0 comments on commit 7644315

Please sign in to comment.