Skip to content

Commit

Permalink
Make sure that the DESCRIPTION file actually has data inside it befor…
Browse files Browse the repository at this point in the history
…e reading
  • Loading branch information
Alexis Lucattini committed Oct 7, 2019
1 parent fe551ea commit f48671b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ load_pkg_description <- function(path) {
stop("No description at ", path_desc, call. = FALSE)
}

# Check description is not empty
if (file.info(path_desc)$size == 0){
stop("Description filie is empty at ", path_desc, call. = FALSE)
}

desc <- as.list(readDcf(path_desc)[1, ])
names(desc) <- tolower(names(desc))
desc$path <- path
Expand Down

0 comments on commit f48671b

Please sign in to comment.