Skip to contents

Pulls file structure for a given repository.

Usage

get_files_structure(
  gitstats_object,
  pattern = NULL,
  depth = Inf,
  cache = TRUE,
  verbose = is_verbose(gitstats_object),
  progress = verbose
)

Arguments

gitstats_object

A GitStats object.

pattern

An optional regular expression. If defined, it pulls file structure for a repository matching this pattern.

depth

An optional integer. Defines level of directories to retrieve files from. E.g. if set to 0, it will pull files only from root, if 1, will take data from root directory and directories visible in root directory. If left with no argument, will pull files from all directories.

cache

A logical, if set to TRUE GitStats will retrieve the last result from its storage.

verbose

A logical, TRUE by default. If FALSE messages and printing output is switched off.

progress

A logical, by default set to verbose value. If FALSE no cli progress bar will be displayed.

Value

A list of vectors.

Examples

if (FALSE) { # \dontrun{
 my_gitstats <- create_gitstats() %>%
  set_github_host(
    token = Sys.getenv("GITHUB_PAT"),
    orgs = c("r-world-devs")
  ) %>%
  set_gitlab_host(
    token = Sys.getenv("GITLAB_PAT_PUBLIC"),
    orgs = "mbtests"
  )
 get_files_structure(
   gitstats_obj = my_gitstats,
   pattern = "\\.md"
 )
} # }