which (function)
Searches the system for the path to a program named binaryName.
If the program can't be found, null is returned.
@parambinaryName — The program to search for@paramoptions — Options which affect how the search is performed@paramoptions.searchPaths — A list of folders where programs may be found. Defaults toenv.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || [].@paramoptions.suffixes — A list of filename extension suffixes to include in the search, ie [".exe"]. Defaults toPath.OS_PROGRAM_EXTENSIONS.@paramoptions.trace — A logging function that will be called at various times during the execution ofwhich. Defaults to logger.trace.
WhichOptions (type)
};
};
WhichOptions.searchPaths (property)
A list of folders where programs may be found. Defaults to
env.PATH?.split(Path.OS_ENV_VAR_SEPARATOR) || [].
WhichOptions.suffixes (property)
A list of filename extension suffixes to include in the search, ie
[".exe"]. Defaults to Path.OS_PROGRAM_EXTENSIONS.
WhichOptions.logging (object property)
Options which control logging.
WhichOptions.logging.trace (function property)
If provided, this logging function will be called multiple times as
which runs, to help you understand what's going on and/or troubleshoot
things. In most cases, it makes sense to use a function from console
here, like so:
Defaults to the current value of logger.trace. logger.trace
defaults to a no-op function.