Skip to content

Commit a748bf7

Browse files
Also search recursively for source files
1 parent dead7d9 commit a748bf7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

R/utils.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ uneverything <- function(x) {
1616
return(unlist(x) |> unname())
1717
}
1818

19+
get_files <- function(path, pattern) {
20+
files <- list.files(path, pattern = pattern, full.names = TRUE, recursive = TRUE) |> normalizePath()
21+
return(files)
22+
}
23+
1924
get_pkg_source_files <- function(pkg) {
2025
path <- file.path(pkg, "R")
21-
files <- list.files(path, pattern = "\\.(R|r)$", full.names = TRUE) |> normalizePath()
26+
files <- get_files(path, "\\.(R|r)$")
2227
return(list(
2328
files = files,
2429
path = path
@@ -27,7 +32,7 @@ get_pkg_source_files <- function(pkg) {
2732

2833
get_pkg_test_files <- function(pkg) {
2934
path <- file.path(pkg, "tests")
30-
files <- list.files(path, pattern = "\\.(R|r)$", full.names = TRUE, recursive = TRUE) |> normalizePath()
35+
files <- get_files(path, "\\.(R|r)$")
3136
return(list(
3237
files = files,
3338
path = path

0 commit comments

Comments
 (0)