Future findChromeExecutableOnMac()

in packages/web_drivers/lib/chrome_driver_installer.dart [137:150]


  Future<String> findChromeExecutableOnMac() async {
    io.Directory chromeDirectory = io.Directory('/Applications')
        .listSync()
        .whereType<io.Directory>()
        .firstWhere(
          (d) => path.basename(d.path).endsWith('Chrome.app'),
          orElse: () => throw Exception('Failed to locate system Chrome'),
        );

    final io.File chromeExecutableDir = io.File(
        path.join(chromeDirectory.path, 'Contents', 'MacOS', 'Google Chrome'));

    return chromeExecutableDir.path;
  }