Skip to content

Commit

Permalink
Update installRPackages.R
Browse files Browse the repository at this point in the history
  • Loading branch information
vyepez88 authored May 28, 2024
1 parent abf9d0f commit 3649f3b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drop/installRPackages.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@ if (file.exists(args[1])){
package=gsub("=.*", "", unlist(args)),
version=gsub(".*=", "", unlist(args)),
ref="")
packages[package == version, c("min_version", "max_version") := ""]
packages[package == version, version:=NA]
}
installed <- as.data.table(installed.packages())

for (pckg_name in packages$package) {
package_dt <- packages[package == pckg_name]
pckg_name <- gsub(".*/", "", pckg_name)
min_version <- package_dt$min_version
max_version <- package_dt$max_version
version <- package_dt$version
branch <- package_dt$ref

if (!pckg_name %in% installed$Package || (min_version != "" && (compareVersion(
installed[Package == pckg_name, Version], min_version) < 0 || compareVersion(
installed[Package == pckg_name, Version], max_version) > 0))) {
if (!pckg_name %in% installed$Package || (!is.na(version) && compareVersion(
installed[Package == pckg_name, Version], version) < 0)) {

package <- package_dt$package
message(paste("install", package))
Expand Down

0 comments on commit 3649f3b

Please sign in to comment.