executablePath method

Future<String?> executablePath(
  1. String executableName, {
  2. bool refresh = false,
})

Returns an executable binary path for executableName.

Implementation

Future<String?> executablePath(String executableName,
    {bool refresh = false}) async {
  executableName = executableName.trim();

  String? binPath;

  if (!refresh) {
    binPath = _whichExecutables[executableName];
    if (binPath != null && binPath.isNotEmpty) {
      return binPath;
    }
  }

  binPath = await _whichExecutableImpl(executableName);
  binPath ??= '';

  _whichExecutables[executableName] = binPath;

  log('INFO', 'executablePath($executableName): $binPath');

  return binPath.isNotEmpty ? binPath : null;
}