Fix bug in docs.dart (#72544)

Add a check that a pubspec file exists before trying to read it.
This commit is contained in:
Todd Volkert 2020-12-17 14:47:45 -08:00 committed by GitHub
parent 1c530a92ac
commit 9a9339fbcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -468,6 +468,10 @@ List<Directory> findPackages() {
if (entity is! Directory)
return false;
final File pubspec = File('${entity.path}/pubspec.yaml');
if (!pubspec.existsSync()) {
print("Unexpected package '${entity.path}' found in packages directory");
return false;
}
// TODO(ianh): Use a real YAML parser here
return !pubspec.readAsStringSync().contains('nodoc: true');
})