write method
Updates one or more top-level YAML sections.
Implementation
Future<void> write(
Map<String, Object?> sections,
) async {
final file = File('fkit.yaml');
if (!file.existsSync()) {
throw Exception(
'fkit.yaml not found. Run "fkit init" first.',
);
}
final content = await file.readAsString();
final editor = YamlEditor(content);
for (final entry in sections.entries) {
editor.update(
[entry.key],
entry.value,
);
}
await file.writeAsString(
editor.toString(),
);
}