Scripts.fromYaml constructor
Implementation
factory Scripts.fromYaml(
Map<Object?, Object?> yaml, {
required String workspacePath,
}) {
final scripts = yaml.map<String, Script>((key, value) {
final name = assertIsA<String>(value: key, key: 'scripts');
if (value == null) {
throw MelosConfigException('The script $name has no value');
}
final script = Script.fromYaml(
value,
name: name,
workspacePath: workspacePath,
);
return MapEntry(name, script);
});
return Scripts(UnmodifiableMapView(scripts));
}