Skip to content

Commit

Permalink
Merge pull request #8 from AlexsLemonade/jashapiro/whatsup
Browse files Browse the repository at this point in the history
Add check for blank second arg
  • Loading branch information
jashapiro authored Mar 11, 2024
2 parents ffc12dd + 5b14cd4 commit ed3e84a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ outputs:
description: The number of spelling errors
runs:
using: "docker"
image: docker://ghcr.io/alexslemonade/spellcheck:v0.1.0
image: docker://ghcr.io/alexslemonade/spellcheck:v0.1.1
args:
- ${{ inputs.dictionary || '/dev/null' }}
- ${{ inputs.files }}
3 changes: 2 additions & 1 deletion spell-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
# To modify this behavior, provide a command-line argument with the extensions to check.

arguments <- commandArgs(trailingOnly = TRUE)

file_pattern <- "(?i)\\.(md|rmd)$"

# dictionary is required first argument
dict_file <- arguments[1]

arguments <- arguments[-1]
# if there are arguments, check those files, otherwise check all markdown & rmd files
if (length(arguments) > 0) {
if (length(arguments) > 0 && arguments[1] != "") {
files <- arguments[grepl(file_pattern, arguments)]
} else {
files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE)
Expand Down

0 comments on commit ed3e84a

Please sign in to comment.