klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
829 stars 47 forks source link

PR for #307 #308

Open jtlandis opened 1 year ago

jtlandis commented 1 year ago

Small edits that make feature request in #307 possible. First, find_mod.box$pkg_spec will try and search for the package eagerly to see if it exists. Otherwise it assumes it is really a module. A small edit has been made to mod_file_candidates() switching out the base file.path for internal function file_path which removes zero length arguments. zero length arguments in file.path will cause the function to return a zero length character vector. This allows find_global_mod to find a mod that is pkg like and does not have a prefix attribute.