Skip to content

Commit 368dbb7

Browse files
committed
easier?
1 parent 3660f29 commit 368dbb7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

R/spell-check-bookdown.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ spell_check_bookdown <- function(path = ".", lang = NULL, use_wordlist = TRUE){
4646
# Add custom words to the ignore list
4747

4848
add_words <- if(isTRUE(use_wordlist))
49-
unlist(strsplit(readLines(get_wordfile(path),
50-
warn = FALSE, encoding = "UTF-8"), " ",
51-
fixed = TRUE))
49+
get_wordfile(path)
5250

5351
if (file.exists(file.path(path, "DESCRIPTION"))){
5452
pkg <- as_package(path)

R/spell-check.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ as_package <- function(pkg){
9393
description <- if(file.exists(file.path(path, "DESCRIPTION.in"))){
9494
file.path(path, "DESCRIPTION.in")
9595
} else {
96-
normalizePath(file.path(path, "DESCRIPTION"), mustWork = TRUE)
96+
normalizePath(file.path(path, "DESCRIPTION"), mustWork = FALSE)
9797
}
98+
99+
if (!file.exists(description)) {
100+
return(list(path = pkg))
101+
}
102+
98103
pkg <- read.dcf(description)[1,]
99104
Encoding(pkg) = "UTF-8"
100105
pkg <- as.list(pkg)

0 commit comments

Comments
 (0)