Skip to content

Commit

Permalink
export detect_dependencies and redoc
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesMcBain committed Aug 4, 2022
1 parent 30b3d8c commit 401d0c9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(create)
export(delete)
export(delete_local_lib)
export(delete_lockfile)
export(detect_dependencies)
export(dev_mirror_lockfile)
export(get_capsule_behind_lockfile)
export(get_local_behind_lockfile)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* New `run_rscript()` can run R scripts in the capsule via `callr::rscript()` (@gadenbuie #27)
* `run_callr()` exposes the `show` option with default to `TRUE`.
* `detect_depencies()` is now exported

# Version 0.4.1

Expand Down
14 changes: 11 additions & 3 deletions R/detect_dependencies.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#' Detect dependencies in nominated R or Rmd files.
#'
#' Get the names of R packages referred to in `file_path`. `file_path` can be a
#' vector of paths if you need, although I advise keeping dependency calls in a
#' single file for R projects.
#'
#' This is a thin wrapper around `[renv::dependencies()]` that includes support
#' for the `[using::pkg()]` style specification via `[using::detect_dependencies()]`
#' @param file_path the file(s) to detect dependencies in.
#' @return a character vector of package names
#' @export
detect_dependencies <- function(file_path) {

renv_deps <-
Expand All @@ -10,6 +21,3 @@ detect_dependencies <- function(file_path) {
using_deps$package))

}



23 changes: 23 additions & 0 deletions man/detect_dependencies.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/run.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 401d0c9

Please sign in to comment.