-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathinstallPackages.R
More file actions
29 lines (24 loc) · 934 Bytes
/
installPackages.R
File metadata and controls
29 lines (24 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Modelled after https://github.com/Bioconductor/bioc_docker/blob/master/out/devel_sequencing/installFromBiocViews.R
library(BiocInstaller)
pkgs_to_install <- c("devtools")
github_pkgs_to_install <- c("isb-cgc/examples-R", "googlegenomics/bioconductor-workshop-r")
cores <- max(2, parallel::detectCores()-2)
if (parallel::detectCores() == 1)
cores <- 1
options(list("Ncpus"=cores))
tryCatch({
biocLite(pkgs_to_install)
biocLite(github_pkgs_to_install, build_vignettes=TRUE, dependencies=TRUE)
},
warning=function(w){
if(length(grep("is not available|had non-zero exit status|installation of one or more packages failed", w$message)))
stop(sprintf("got a fatal warning: %s", w$message))
})
warnings()
if (!is.null(warnings()))
{
w <- capture.output(warnings())
if (length(grep(
"is not available|had non-zero exit status|installation of one or more packages failed", w)))
quit("no", 1L)
}