Skip to content

Commit

Permalink
Merge pull request #1712 from dklein-pik/develop
Browse files Browse the repository at this point in the history
Use the folder from which the R session is started as the renv project folder
  • Loading branch information
dklein-pik authored Jun 20, 2024
2 parents e628b45 + 25d7c96 commit 4adb45c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if (file.exists("renv.lock") && file.exists("README.md") && !file.exists("renv/o
# do not check if library and renv.lock are in sync, because normally renv.lock does not exist
options(renv.config.synchronized.check = FALSE)

# always set the renv project to the current directory (formerly done by renv/activate.R under version 0.16.0)
Sys.setenv("RENV_PROJECT" = getwd())

source("renv/activate.R")

# when increasing renvVersion first commit new version's activate script and
Expand Down
1 change: 1 addition & 0 deletions scripts/start/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ run <- function() {
if (normalizePath(renv::project()) != normalizePath(outputdir)) {
warning("loaded renv=", normalizePath(renv::project()), " and outputdir=", normalizePath(outputdir), " must be equal.")
}
message("Using ", normalizePath(renv::project()), " as renv project")
argv <- c(get0("argv"), paste0("--renv=", renv::project()))
}

Expand Down

0 comments on commit 4adb45c

Please sign in to comment.