Skip to content

Commit

Permalink
renv / codespaces update from pharmaverse/admiralci
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrassellyb authored and pharmaverse-bot committed Aug 2, 2023
1 parent 0cfd0e9 commit f458cd4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Set renv profile base on R version.
if ((Sys.getenv("GITHUB_ACTIONS") == "") && (Sys.getenv("DOCKER_CONTAINER_CONTEXT") == "")) {
renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".")
if (file.exists("./renv/profile")) {
message("Using renv profile from `renv/profile` file.")
} else if (renv_profile %in% c("4.1", "4.2", "4.3")) {
renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".")
if (file.exists("./renv/profile")) {
message("Using renv profile from `renv/profile` file.")
if (renv_profile %in% c("4.1", "4.2", "4.3")) {
message("Set renv profile to `", renv_profile, "`")
Sys.setenv("RENV_PROFILE" = renv_profile)
} else {
message("This repository do not contains the renv profile for your R version.")
message("This repository do not contains the renv profile for your R version.")
}
source("renv/activate.R")
} else {
}

if ((Sys.getenv("GITHUB_ACTIONS") != "") || (Sys.getenv("DOCKER_CONTAINER_CONTEXT") != "")) {
options(repos = c(CRAN = "https://cran.rstudio.com"))
Sys.setenv(RENV_AUTOLOADER_ENABLED=FALSE)
}
source("renv/activate.R")

0 comments on commit f458cd4

Please sign in to comment.