getPubspecs method

  1. @protected
Future<List<File>> getPubspecs()

Implementation

@protected
Future<List<File>> getPubspecs() async {
  final projectPath = p.current;
  final pubspecSearch = Glob("**$_pubspecFileName");
  final pubspecFiles = <File>[];
  await for (final file
      in pubspecSearch.list(root: projectPath, followLinks: false)) {
    if (file is File && p.basename(file.path) == _pubspecFileName) {
      printVerbose('Found ${file.path}');
      pubspecFiles.add(file);
    }
  }

  if (pubspecFiles.isEmpty) {
    printInfo('Pubspec files are not found');
  }

  return pubspecFiles;
}