findSpyYamlFiles static method

List<String> findSpyYamlFiles(
  1. String serverPackagePath
)

Find all .spy.yaml files in the server package

Implementation

static List<String> findSpyYamlFiles(String serverPackagePath) {
  final files = <String>[];

  final libDir = Directory(p.join(serverPackagePath, 'lib', 'src'));
  if (!libDir.existsSync()) return files;

  // Recursively find all .spy.yaml files
  for (final entity in libDir.listSync(recursive: true)) {
    if (entity is File && entity.path.endsWith('.spy.yaml')) {
      files.add(entity.path);
    }
  }

  return files;
}