From 0277b6a2be3c50edc78cd6f76c5028217216a969 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 3 Jun 2019 18:27:51 +0200 Subject: [PATCH] update_r_packages: upgrade the dependencies of packaages installed from github without asking for confirmation. --- library/roles/R/templates/update_r_packages.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/roles/R/templates/update_r_packages.sh.j2 b/library/roles/R/templates/update_r_packages.sh.j2 index fd80698f..981b8de9 100644 --- a/library/roles/R/templates/update_r_packages.sh.j2 +++ b/library/roles/R/templates/update_r_packages.sh.j2 @@ -202,11 +202,11 @@ function r_github_pkgs() { pkg=$( echo $l | cut -d "/" -f 2 ) if [ "$ACTION" == "upgrade" ] ; then #Rscript --slave --no-save --no-restore-history -e "require(devtools); require(methods); install_github('$l');" - Rscript --slave --no-save --no-restore-history -e "require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install)" + Rscript --slave --no-save --no-restore-history -e "require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='always')" else #Rscript --slave --no-save --no-restore-history -e "if (! ('$pkg' %in% installed.packages()[,'Package'])) { require(devtools); require(methods) ; install_github('$l'); }" - Rscript --slave --no-save --no-restore-history -e "if (! ('$pkg' %in% installed.packages()[,'Package'])) { require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install) }" + Rscript --slave --no-save --no-restore-history -e "if (! ('$pkg' %in% installed.packages()[,'Package'])) { require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='always') }" fi done else