cmdfun
cmdfun copied to clipboard
cmd_install_check throws "path must be character" error if path = NULL and no env var or option is set
Solution:
x <- try(path_search(path = path) %>% cmd_ui_file_exists(),
silent = TRUE)
if (class(x) == "try-error") {
# if block below is the addition, make the message a little nicer, but this is the general idea. Don't throw warning, inform that nothing is set.
if (is.null(path)) {message("path not detected")}
cmd_ui_file_exists(path)
return(invisible(NULL))
}