mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-21 13:41:19 -05:00
60983d395f
- Fail if the installation of a R package fails. - Install the remotes package once during the image build, and not when we scan files at runtime. - Reuse the default R library directory instead of moving it to /home/r-library
12 lines
391 B
R
Executable file
12 lines
391 B
R
Executable file
#!/usr/bin/env Rscript
|
|
|
|
# Based on: https://stackoverflow.com/questions/26244530/how-do-i-make-install-packages-return-an-error-if-an-r-package-cannot-be-install
|
|
|
|
packages = commandArgs(trailingOnly=TRUE)
|
|
|
|
for (l in packages) {
|
|
install.packages(l, repos='https://cloud.r-project.org/');
|
|
if ( ! library(l, character.only=TRUE, logical.return=TRUE) ) {
|
|
quit(status=1, save='no')
|
|
}
|
|
}
|