registerProtocolHandler function

Future<void> registerProtocolHandler([
  1. String? neomagePath
])

Register the neomage-cli:// protocol handler with the operating system.

Implementation

Future<void> registerProtocolHandler([String? neomagePath]) async {
  final resolved = neomagePath ?? await _resolveNeomagePath();

  if (Platform.isMacOS) {
    await _registerMacos(resolved);
  } else if (Platform.isLinux) {
    await _registerLinux(resolved);
  } else if (Platform.isWindows) {
    await _registerWindows(resolved);
  } else {
    throw UnsupportedError('Unsupported platform: ${Platform.operatingSystem}');
  }
}