|
| 1 | +# Based on Jeroen's config: |
| 2 | +# https://github.com/r-universe-org/base-image/blob/f20ec9fc6f51ef8a89aad489206a43790bd9bf77/Rprofile |
| 3 | + |
| 4 | +local({ |
| 5 | +rver <- getRversion() |
| 6 | +distro <- system2('lsb_release', '-sc', stdout = TRUE) |
| 7 | +options(HTTPUserAgent = sprintf("R/%s R (%s)", rver, paste(rver, R.version$platform, R.version$arch, R.version$os))) |
| 8 | +options(repos = c(CRAN = sprintf("https://packagemanager.rstudio.com/all/__linux__/%s/latest", distro))) |
| 9 | + |
| 10 | +# Enable BioConductor repos |
| 11 | +utils::setRepositories(ind = 1:4, addURLs = c(fallback = "https://cloud.r-project.org")) |
| 12 | + |
| 13 | +# Enable universe repo(s) |
| 14 | +my_universe <- Sys.getenv("MY_UNIVERSE", "https://cran.r-universe.dev") |
| 15 | +if(nchar(my_universe)){ |
| 16 | + my_repos <- trimws(strsplit(my_universe, ';')[[1]]) |
| 17 | + binaries <- sprintf('%s/bin/linux/%s/%s', my_repos[1], distro, substr(rver, 1, 3)) |
| 18 | + options(repos = c(binaries = binaries, universe = my_repos, getOption("repos"))) |
| 19 | +} |
| 20 | + |
| 21 | +# Other settings |
| 22 | +options(crayon.enabled = TRUE) |
| 23 | +Sys.unsetenv(c("CI", "GITHUB_ACTIONS")) |
| 24 | + |
| 25 | +# Dummy token for API limits |
| 26 | +if(is.na(Sys.getenv("GITHUB_PAT", NA))){ |
| 27 | + dummy <- c('ghp_SXg', 'LNM', 'Tu4cnal', 'tdqkZtBojc3s563G', 'iqv') |
| 28 | + Sys.setenv(GITHUB_PAT = paste(dummy, collapse = 'e')) |
| 29 | +} |
| 30 | +}) |
| 31 | + |
0 commit comments