isCommand static method

bool isCommand(
  1. String command
)

Checks if command is executable on this system.

Implementation

static bool isCommand(String command) {
  final result =
      Process.runSync('command', ['-v', command], runInShell: true);
  return result.exitCode == 0 && result.stdout.toString().trim().isNotEmpty;
}