Closed ambertin closed 5 years ago
@ambertin I don't think check_is_dir()
needs to be a "check" (like the other checks). I think it should just be a regular function (probably put it in utils.R
). Basically:
fs::is_dir()
- takes a path and return TRUE/FALSE
fertile::check_is_dir()
- takes a path and either returns the path to a directory or throws an error (with a helpful message). Use rlang::abort()
to throw the error. @beanumber I edited and moved check_is_dir()
into utils.R
, and moved the tests for the function into test-fertile.R
. Let me know if this looks better!
Nice.
Added
check_is_dir
tochecks.R
, and included it in all of the functions that require directories inchecks.R
.Added tests to
test-check.R
to make sure thatcheck_is_dir
works as intended.@beanumber Is this check formatting correct, or do I need to alter something? Should there be an error message that comes up if
check_is_dir
fails inside some of the other checks? If so, how should that be included? I'm not sure where exactly to put it.