parsePubspecSync function

Pubspec parsePubspecSync(
  1. Directory directory
)

Parse the pubspec of the given directory.

Throws if the parsing fails, such as if the file is badly formatted or does not exists.

Implementation

Pubspec parsePubspecSync(Directory directory) {
  return Pubspec.parse(directory.pubspec.readAsStringSync());
}