dependenciesGenerator top-level property

FigGenerator dependenciesGenerator
final

Implementation

final FigGenerator dependenciesGenerator = FigGenerator(
  script: {
    'command': 'bash',
    'args': [
      '-c',
      'awk \'/dependencies = \\[/ {f=1; next} /\\]/ {f=0} f && /"/ {line = \$0; gsub(/^[ \\t]*"/, "", line); sub(/>=.*\$/, "", line); gsub(/",?\$/, "", line); print line}\' pyproject.toml',
    ],
  },
  postProcess: (out, [tokens]) {
    return out
        .split('\n')
        .where((line) => line.trim().isNotEmpty)
        .map((line) => FigSuggestion(
              name: line,
              description: 'Dependency',
              icon: '📦',
              priority: 80,
            ))
        .toList();
  },
);