R/extern.R

Defines functions available.external

## Non-exported function to gracefully fail when external dependencies are missing.
available.external <- function(what){
  chr <- NULL
  try(chr <- system(str_c(what, '--help'), intern = TRUE), silent = TRUE)
  if(is.null(chr)){
    stop(paste("vsearch was not found,please executable command:", what))
    return(FALSE)
  } else {
    return(TRUE)
  }
}
larssnip/microRMS documentation built on July 19, 2023, 1:06 a.m.