Skip to content

Commit

Permalink
Merge pull request #12 from sjspielman/sjspielman/spellcheck-files
Browse files Browse the repository at this point in the history
Update file glob code
  • Loading branch information
sjspielman authored Apr 24, 2024
2 parents 107c760 + 08f359a commit 205ea3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spell-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ dict_file <- arguments[1]
arguments <- arguments[-1]
# if there are arguments, check those files, otherwise check all markdown & rmd files
if (length(arguments) > 0 && arguments[1] != "") {
files <- arguments[grepl(file_pattern, arguments)]
files_glob <- strsplit(arguments, " ") |>
unlist() |>
Sys.glob() |>
unique()
files <- grep(file_pattern, files_glob, value = TRUE)
} else {
files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE)
}
Expand Down

0 comments on commit 205ea3e

Please sign in to comment.