commandExists method

Future<bool> commandExists(
  1. String command
)

Check if a command exists on the system

Implementation

Future<bool> commandExists(String command) async {
  try {
    final ProcessResult result = await run(Platform.isWindows ? 'where' : 'which', <String>[
      command,
    ]);
    return result.success;
  } catch (e) {
    return false;
  }
}