yeomanGeneratorList top-level property

FigGenerator yeomanGeneratorList
final

Implementation

final FigGenerator yeomanGeneratorList = FigGenerator(
  script: ['yo', '--generators'],
  postProcess: (String out, [List<String>? tokens]) {
    try {
      return out
          .split('\n')
          .where((item) =>
              item.trim().isNotEmpty && item != 'Available Generators:')
          .map((item) {
        final name = item.trim();
        final displayName = toTitleCase(name);
        return FigSuggestion(
          name: name,
          icon: 'https://avatars.githubusercontent.com/u/1714870?v=4',
          displayName: displayName,
          description: '$displayName Generator',
          priority: 100,
          loadSpec: FigSubcommand(
            name: name,
            description: '$displayName Generator',
            options: [
              FigOption(
                name: ['--help'],
                description: 'Help of "$displayName" generator',
              ),
            ],
          ),
        );
      }).toList();
    } catch (e) {
      // ignore: avoid_print
      // print(e);
      return [];
    }
  },
);