You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4bd0eac
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: R/packageCellar.R
+15-27Lines changed: 15 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
#' `packageCellar()` saves files from a renv.lock file into the 'cellar' folder in `renv`
2
2
#'
3
-
#' @param path Character string giving the cellar path. If omitted, defaults to `renv/cellar`.
3
+
#' @param path Character string giving the cellar path. This must be supplied explicitly.
4
4
#' @param project Character string giving the project path. If omitted, defaults to `usethis::proj_get()`.
5
5
#' @param lockfile Character string giving the lockfile path. If omitted, defaults to `renv.lock` at the project base level provided by `usethis::proj_get()`.
6
6
#' @param type Character string specifying whether to download all packages (`"complete"`) or only packages from GitHub (`"github"`).
@@ -15,7 +15,7 @@
15
15
#'
16
16
#' \dontrun{
17
17
#' # It will download the tar files for every package in the renv.lock
cli::cli_abort("{.arg path} must be supplied explicitly.")
41
37
}
42
38
if (!dir.exists(path)) {
43
39
dir.create(
@@ -161,9 +157,9 @@ downloadGithub <- function(
161
157
162
158
#' `installCellar()` install files already saved in a cellar
163
159
#'
164
-
#' @param path Character string giving the cellar path. If omitted, defaults to `renv/cellar`.
160
+
#' @param path Character string giving the cellar path. This must be supplied explicitly.
165
161
#' @param project Character string giving the project path. If omitted, defaults to `usethis::proj_get()`.
166
-
#' @param library Character string giving the library path. If omitted, defaults to `renv/library`.
162
+
#' @param library Character string giving the library path. This must be supplied explicitly.
167
163
#' @param lockfile Character string giving the lockfile path. If omitted, defaults to `renv.lock` at the project base level provided by `usethis::proj_get()`.
168
164
#'
169
165
#' @returns Invisible
@@ -176,7 +172,10 @@ downloadGithub <- function(
176
172
#'
177
173
#' \dontrun{
178
174
#' # It will install all packages in the cellar
179
-
#' installCellar()
175
+
#' installCellar(
176
+
#' path = file.path(tempdir(), "cellar"),
177
+
#' library = file.path(tempdir(), "library")
178
+
#' )
180
179
#' }
181
180
installCellar<-function(
182
181
path,
@@ -188,27 +187,16 @@ installCellar <- function(
188
187
project<-usethis::proj_get()
189
188
}
190
189
if (missing(path)) {
191
-
path<- file.path(
192
-
project,
193
-
"renv",
194
-
"cellar"
195
-
) |>
196
-
normalizePath()
190
+
cli::cli_abort("{.arg path} must be supplied explicitly.")
197
191
}
198
192
checkmate::assertDirectoryExists(path)
199
193
if (missing(library)) {
200
-
library<- file.path(
201
-
project,
202
-
"renv",
203
-
"library"
204
-
)
205
-
library|>
206
-
dir.create(
207
-
recursive=TRUE
208
-
)
209
-
library<-library|>
210
-
normalizePath()
194
+
cli::cli_abort("{.arg library} must be supplied explicitly.")
0 commit comments