Skip to content

Commit

Permalink
make guess_filesize fail gracefully if package cannot be built. cf ro…
Browse files Browse the repository at this point in the history
maelle committed Dec 4, 2018
1 parent 47db9a8 commit 8df7b64
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions R/guess_other_metadata.R
Original file line number Diff line number Diff line change
@@ -32,10 +32,16 @@ guess_fileSize <- function(root = ".") {
return(NULL)
} else {
f <-
pkgbuild::build(root,
try(pkgbuild::build(root,
vignettes = FALSE,
manual = FALSE,
quiet = TRUE)
paste0(file.size(f) / 1e3, "KB")
quiet = TRUE),
silent = TRUE)
if(inherits(f, "try-error")){
return(NULL)
}else{
return(paste0(file.size(f) / 1e3, "KB"))
}

}
}

0 comments on commit 8df7b64

Please sign in to comment.