MultiSettings.load constructor

MultiSettings.load({
  1. String? pathTo,
})

Load the pubrelease_multi.yaml into memory. pathTo is intended for aiding with unit testing by allowing the test to pass an alternate path. Normally pathTo should not be passed as the file will be loaded from its default location. If you pass pathTo it must include the filename.

Implementation

MultiSettings.load({String? pathTo}) {
  pathTo ??= pathToYaml;
  final settings = SettingsYaml.load(pathToSettings: pathTo);

  for (final entry in settings.valueMap.entries) {
    final package =
        Package(entry.key, truepath(homeProjectPath, entry.value as String));
    if (!exists(package.path)) {
      throw PubReleaseException(
          'The path ${package.path} for ${package.name} does not exist.');
    }

    if (!exists(join(package.path, 'pubspec.yaml'))) {
      throw PubReleaseException(
          'The pubspec.yaml for ${package.name} does not exist.');
    }

    packages.add(package);
  }
}