projectname top-level property

FigGenerator projectname
final

Implementation

final FigGenerator projectname = FigGenerator(
  script: [
    'bash',
    '-c',
    '{ find * -maxdepth 0 -type f -name \'*.nf\' 2> /dev/null && find \$HOME/.nextflow/assets/* -maxdepth 1 -type d | cut -d/ -f6,7 | grep / | grep -v assets; } 2> /dev/null',
  ],
  postProcess: (String output, [List<String>? tokens]) {
    if (output.isEmpty) {
      return <FigSuggestion>[];
    }
    return output
        .split('\n')
        .where((projectname) => projectname.trim().isNotEmpty)
        .map((projectname) => FigSuggestion(
              name: projectname.replaceAll('*', '').trim(),
              description: 'Project name',
            ))
        .toList();
  },
);