generated from pharmaverse/admiraltemplate
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renv / codespaces update from pharmaverse/admiralci
- Loading branch information
1 parent
0cfd0e9
commit f458cd4
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |