cmdfun icon indicating copy to clipboard operation
cmdfun copied to clipboard

cmd_install_check throws "path must be character" error if path = NULL and no env var or option is set

Open snystrom opened this issue 3 years ago • 0 comments

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))
    }

snystrom avatar Mar 30 '21 15:03 snystrom