-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Sage-Bionetworks-IT/rstudio…
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 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
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,15 @@ | ||
#!/usr/bin/env Rscript | ||
# from https://stackoverflow.com/questions/26244530/how-do-i-make-install-packages-return-an-error-if-an-r-package-cannot-be-install | ||
# install the latest versions of a list of packages and fail | ||
# if any package fails to install | ||
|
||
packages = commandArgs(trailingOnly=TRUE) | ||
|
||
for (l in packages) { | ||
|
||
install.packages(l, dependencies=TRUE, repos=c('http://ran.synapse.org', 'https://cran.rstudio.com')) | ||
|
||
if ( ! library(l, character.only=TRUE, logical.return=TRUE) ) { | ||
quit(status=1, save='no') | ||
} | ||
} |
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,15 @@ | ||
#!/usr/bin/env Rscript | ||
# install a specific version of a given package and fail if | ||
# the package fails to install | ||
|
||
theargs = commandArgs(trailingOnly=TRUE) | ||
|
||
package=theargs[1] | ||
version=theargs[2] | ||
|
||
install.packages('remotes', dependencies=TRUE, repos='https://cran.rstudio.com') | ||
remotes::install_version(package, version = version, repos = 'https://cran.rstudio.com') | ||
|
||
if ( ! library(package, character.only=TRUE, logical.return=TRUE) ) { | ||
quit(status=1, save='no') | ||
} |