R/file_utilities.R

Defines functions .findExecutable

Documented in .findExecutable

#' Find executable
#'
#' @param exe
#' @param interactive
#'
#' @return
#' @export
#'
#' @examples
.findExecutable <- function(exe, interactive=TRUE) {
  path <- Sys.which(exe)
  if(all(path=="")) {
    if(interactive) stop("Executable for ", paste(exe, collapse=" or "), " not found! Please make sure that the software is correctly installed and, if necessary, path variables are set.", call.=FALSE)
    return(character(0))
  }

  path[which(path!="")[1]]
}
alexpiper/seqateurs documentation built on July 9, 2023, 7:21 a.m.