Closed bertcarnell closed 1 day ago
I would probably go a little more conservative with
list.files(path, pattern = "^NEWS($|\\.)", full.names = TRUE)
Also, the code below will need changed. Something like (note the change in the else if
f = files[[i]]
tryCatch(
{
ext = tolower(tools::file_ext(f))
if (ext == "rd") {
content[[i]] = .tools$.news_reader_default(f)
} else if (ext == "md" || nchar(ext) == 0L) {
# NOTE: should we do validation of markdown format?
content[[i]] = readLines(f, warn = FALSE)
}
valid[[i]] = TRUE
},
error = function(e) {
valid[[i]] = FALSE
}
)
}
The
riskmetric:::news_from_dir
function does not find a NEWS file without an extension.Reproducible example:
The reason that lhs failes and riskmetric works is that riskmetric includes a "NEWS.md" while lhs only includes a "NEWS".