Created
March 4, 2020 21:19
-
-
Save franzbischoff/08d95547cfc6ad72568496c654735fc7 to your computer and use it in GitHub Desktop.
Check which files are ignored and which will stay in your R package using .Rbuildignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check_buildignore <- function() { | |
patterns <- readLines(".Rbuildignore") | |
hits <- list() | |
for (pat in patterns) { | |
hit <- dir( | |
full.names = FALSE, recursive = TRUE, | |
all.files = TRUE, include.dirs = TRUE, no.. = TRUE | |
)[grepl( | |
pat, | |
dir( | |
full.names = FALSE, recursive = TRUE, | |
all.files = TRUE, include.dirs = TRUE, no.. = TRUE | |
) | |
)] | |
hits[[pat]] <- hit | |
} | |
root <- dir( | |
pattern = ".*", | |
full.names = FALSE, recursive = FALSE, | |
all.files = TRUE, include.dirs = TRUE, no.. = TRUE | |
) | |
pass <- root[!(root %in% unique(unlist(hits)))] | |
return(list(ignored = hits, pass = pass)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment