where method

String where(
  1. String executable
)

Implementation

String where(String executable) {
  var output = '';
  if (isDesktop) {
    final cmd = isWindows ? 'where' : 'which';
    final args = [executable];
    final result = Process.runSync(cmd, args);
    if (result.exitCode == 0) output = result.stdout.toString().trim();
  }
  return output;
}