diff --git a/R/install_packages.R b/R/install_packages.R index df4dea72..b893d034 100644 --- a/R/install_packages.R +++ b/R/install_packages.R @@ -89,7 +89,7 @@ install_packages_cran <- function(packages, instructions=FALSE) { return(character(0)) } if (instructions) { - sprintf("install.packages(%s)", + sprintf("install.packages(c(%s))", paste(dquote(packages), collapse=", ")) } else { ## This is super annoying but means that we'll hopefully get diff --git a/tests/testthat/test-install-packages.R b/tests/testthat/test-install-packages.R index b8fded4b..4f8770aa 100644 --- a/tests/testthat/test-install-packages.R +++ b/tests/testthat/test-install-packages.R @@ -15,7 +15,7 @@ test_that("sources", { test_that("install_packages", { extras <- read_remake_packages("remake_sources.yml") - cmp_devtools_cran <- 'install.packages("devtools")' + cmp_devtools_cran <- 'install.packages(c("devtools"))' expect_equal(install_packages("devtools", TRUE, FALSE, extras), cmp_devtools_cran) expect_equal(install_packages("sowsear", TRUE, FALSE, extras), @@ -57,7 +57,7 @@ test_that("loading a remakefile with a missing package", { cleanup() obj <- suppressWarnings(remake("remake_missing_package.yml")) expect_error(.remake_initialize_packages(obj), - 'install.packages("nosuchpackage")', fixed=TRUE) + 'install.packages(c("nosuchpackage"))', fixed=TRUE) skip_unless_set("REMAKE_TEST_INSTALL_PACKAGES") expect_warning(m <- remake("remake_missing_package.yml", allow_cache=FALSE),