doDescribe method

  1. @override
Future<Pubspec> doDescribe(
  1. PackageId id,
  2. SystemCache cache
)

If id is already in the system cache, just loads it from there.

Otherwise, defers to the subclass.

Implementation

@override
Future<Pubspec> doDescribe(PackageId id, SystemCache cache) async {
  var packageDir = getDirectoryInCache(id, cache);
  if (fileExists(p.join(packageDir, 'pubspec.yaml'))) {
    return Pubspec.load(
      packageDir,
      cache.sources,
      expectedName: id.name,
      containingDescription: id.description.description,
    );
  }

  return await describeUncached(id, cache);
}