R/pattern_checker.R

Defines functions pattern_checker

#' Title
#'
#' @param pattern
#' @param bids
#' @param ext
#'
#' @return
#' @export
#'
#' @examples
pattern_checker <- function(pattern, bids = character(0), ext = "Rmd") {
  writeLines(pattern)
  cmd <- paste0("grep -Przil --include=*.", ext, " '", pattern, "'")
  a <- system(cmd, intern = TRUE)
  found <- unique(sort(get_bid(a)))
  list(found = found, not_found = setdiff(bids, found))
}
elmstedt/autograder documentation built on May 9, 2020, 8:42 a.m.