tryParsePubspec function

Future<Pubspec?> tryParsePubspec(
  1. Directory directory
)

Try parsing the pubspec of the given directory.

If the parsing fails for any reason, returns null.

Implementation

Future<Pubspec?> tryParsePubspec(Directory directory) async {
  try {
    return await parsePubspec(directory);
  } catch (_) {
    return null;
  }
}