From 8e55fa1426158be69ecbc2450afa5669f0c0429e Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Wed, 24 Apr 2024 12:09:08 -0400 Subject: [PATCH 1/2] file glob update --- spell-check.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spell-check.R b/spell-check.R index 7e0fc80..7f09ff3 100644 --- a/spell-check.R +++ b/spell-check.R @@ -14,7 +14,10 @@ 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() + files <- grep(file_pattern, files_glob, value = TRUE) } else { files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE) } From 08f359a5a130e8163e89cc2269d939c755c64bc6 Mon Sep 17 00:00:00 2001 From: Stephanie Spielman Date: Wed, 24 Apr 2024 13:05:55 -0400 Subject: [PATCH 2/2] Update spell-check.R Co-authored-by: Joshua Shapiro --- spell-check.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spell-check.R b/spell-check.R index 7f09ff3..56f63be 100644 --- a/spell-check.R +++ b/spell-check.R @@ -16,7 +16,8 @@ arguments <- arguments[-1] if (length(arguments) > 0 && arguments[1] != "") { files_glob <- strsplit(arguments, " ") |> unlist() |> - Sys.glob() + Sys.glob() |> + unique() files <- grep(file_pattern, files_glob, value = TRUE) } else { files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE)