Match a package name to the content of files.
Arguments
- pkg_name
character string: the package name that should be present in the checked fields and files.
- pkg_dir
character string: the path to the directory where to look for files. Subdirectories are not checked.
- file_patterns
character vector containing regular expressions to match to file names in
pkg_dir, using case-insensitive matching. Can becharacter(0)to not check any files. Hidden files (i.e., files with names starting with a dot) are not found.- warn_files_absent
TRUEorFALSE: warn if files matchingfile_patternsare absent frompkg_dir, or ifcitation_fieldsis notcharacter(0)and the CITATION file is absent frompkg_dir. Missing files are silently ignored ifwarn_files_absentisFALSE.
Value
The paths to the files that were checked, returned invisibly.
Examples
match_pkg_name(pkg_name = "develcoder",
warn_files_absent = FALSE)
match_pkg_name(pkg_name = "develcoder",
warn_files_absent = TRUE)
#> Warning: No files found matching pattern '\NEWS'
#> Warning: No files found matching pattern '\README'
#> Warning: No files found matching pattern '\_pkgdown'