Skip to contents

Recursively scans a local evidence directory for source files suitable for ragnar conversion. build_rag_store() uses this helper with ragcat defaults so the main build API only needs local_file_path.

Usage

list_local_source_files(
  local_file_path = "data/local_sources",
  file_extensions = LOCAL_FILE_EXTENSIONS,
  recursive = TRUE,
  exclude_dirs = NULL
)

Arguments

local_file_path

Directory containing local source files.

file_extensions

Character vector of file extensions to include.

recursive

Logical; scan recursively.

exclude_dirs

Optional character vector of generated directories to exclude.

Value

A tibble of local file candidates.

Examples

source_dir <- tempfile("sources_")
dir.create(source_dir)
writeLines("example evidence text", file.path(source_dir, "example.txt"))
list_local_source_files(source_dir, file_extensions = "txt")
#> # A tibble: 1 × 4
#>   localPath                               fileName fileExtension sourceDirectory
#>   <chr>                                   <chr>    <chr>         <chr>          
#> 1 /tmp/RtmpJurnP1/sources_19d64de167a8/e… example… txt           /tmp/RtmpJurnP…