-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update R tester to allow renv.lock file upload (#581)
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Script to install dependencies for R tester environment using a renv.lock file. | ||
|
||
# Install renv if not already installed | ||
if (!("renv" %in% rownames(installed.packages()))) { | ||
install.packages("renv") | ||
} | ||
library(renv) | ||
|
||
# Set the path for the renv.lock file and the env_dir directory | ||
lockfile <- commandArgs(trailingOnly = TRUE)[1] | ||
env_dir <- commandArgs(trailingOnly = TRUE)[2] | ||
|
||
if (!file.exists(lockfile)) { | ||
stop("renv.lock file not found: ", lockfile) | ||
} | ||
|
||
# Initialize the renv environment and restore dependencies from the lockfile | ||
renv::restore(lockfile = lockfile, library = env_dir) |
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
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