sourceLocation property

String get sourceLocation

Returns the location where the source can be found

Implementation

String get sourceLocation {
  String sourceLocation = unknownSource;
  File file = File(join(fromUri(package.root), 'pubspec.yaml'));
  if (!file.existsSync()) {
    return throw FileSystemException(
      'pubspec.yaml file not found in package $name.',
    );
  }

  sourceLocation =
      Pubspec.parseYaml(file.readAsStringSync()).repositoryOrHomepage ??
          unknownSource;

  return sourceLocation;
}