-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.R
25 lines (22 loc) · 809 Bytes
/
build.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# From https://stackoverflow.com/questions/54634056/how-to-include-an-html-vignette-in-a-binary-r-package
library(cli)
build_vignettes_to_inst <- function() {
targets = c('doc','Meta')
lapply(targets, function(target) {
to = paste0("inst/", target)
unlink(to, recursive = TRUE) # Remove the directories if they exist
dir.create(to, recursive = TRUE, showWarnings = FALSE)
ok = file.copy(list.files(target, full.names = TRUE), to = to)
if(all(ok)) {
cat_bullet("Files intalled into ", to, bullet="tick", col = "green")
} else {
cat_bullet("Problem during copy into ", to, bullet="cross", col = "red")
}
})
invisible()
}
devtools::build_vignettes()
build_vignettes_to_inst()
devtools::build(binary=TRUE)
unlink("inst/Meta", recursive = TRUE)
devtools::build()