whichExecutablePath function

String whichExecutablePath(
  1. String executable, {
  2. bool useCache = true,
  3. String? def,
})

Returns an executable binary path.

  • If useCache is true will use the cached resolutions.

Implementation

String whichExecutablePath(String executable,
    {bool useCache = true, String? def}) {
  executable = executable.trim();

  if (useCache) {
    var cached = _cachedExecutablesPaths[executable];
    if (cached != null) return cached;
  }

  var path = _whichExecutablePathImpl(executable, def);
  _cachedExecutablesPaths[executable] = path;

  return path;
}