parse method

Pubspec parse(
  1. String path
)

Parse the pubspec.yaml file

Implementation

Pubspec parse(String path) {
  try {
    final pubspecFile = File(path);
    final pubspecContent = pubspecFile.readAsStringSync();
    return Pubspec.parse(pubspecContent);
  } on Exception catch (_) {
    throw PubspecParseException();
  }
}