Skip to content

Commit

Permalink
checksum functions: add 'no directory' precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
florisvdh committed Mar 24, 2021
1 parent 4572779 commit 0cec424
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/filemanagement.R
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,12 @@ sha256sum <- function(files) {
assert_that_allfiles_exist <- function(x) {
exist <- file.exists(x)
assert_that(all(exist),
msg = paste0("The following file(s) do not exist:\n",
msg = paste0("The following path(s) do not exist:\n",
paste0(x[!exist], collapse = "\n")))
isfolder <- dir.exists(x)
assert_that(!any(isfolder),
msg = paste0("The following path(s) are folders; only ",
"files are accepted:\n",
paste0(x[isfolder], collapse = "\n")))
}

0 comments on commit 0cec424

Please sign in to comment.