parseAppleLipoArchitectures function

Set<String> parseAppleLipoArchitectures(
  1. String output
)

Implementation

Set<String> parseAppleLipoArchitectures(String output) {
  final fatMatch = RegExp(
    r'\bare:\s*(.+)',
    caseSensitive: false,
  ).firstMatch(output);
  if (fatMatch != null) {
    return fatMatch
        .group(1)!
        .trim()
        .split(RegExp(r'\s+'))
        .where((architecture) => architecture.isNotEmpty)
        .toSet();
  }

  final thinMatch = RegExp(
    r'\bis architecture:\s*([^\s]+)',
    caseSensitive: false,
  ).firstMatch(output);
  return thinMatch == null ? const {} : {thinMatch.group(1)!};
}