Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the folder from which the R session is started as the renv project folder #1712

Merged
merged 6 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 direcotry (formerly done by renv/activate.R under version 0.16.0)
dklein-pik marked this conversation as resolved.
Show resolved Hide resolved
Sys.setenv("RENV_PROJECT" = getwd())

source("renv/activate.R")

# when increasing renvVersion first commit new version's activate script and
Expand Down
2 changes: 1 addition & 1 deletion scripts/start/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ run <- function() {
# make sure the renv used for the run is also used for generating output
if (!is.null(renv::project())) {
if (normalizePath(renv::project()) != normalizePath(outputdir)) {
warning("loaded renv=", normalizePath(renv::project()), " and outputdir=", normalizePath(outputdir), " must be equal.")
dklein-pik marked this conversation as resolved.
Show resolved Hide resolved
stop("loaded renv=", normalizePath(renv::project()), " and outputdir=", normalizePath(outputdir), " must be equal.")
}
argv <- c(get0("argv"), paste0("--renv=", renv::project()))
}
Expand Down
Loading