getReleaseNotes method
Implementation
Future<String?> getReleaseNotes(
Version version,
String changeLog,
Map<String, String> prompt,
) async {
const port = 4024;
final data = getRawReleaseNotes(port, changeLog, prompt);
// ignore: unawaited_futures
openUrl("http://localhost:$port");
final entries = await data;
final major = version.major;
final minor = version.minor;
final patch = version.patch;
final v = "$major.$minor.$patch";
String? result;
for (final entry in entries) {
final ln = entry.lang;
for (final kv in entry.values.entries) {
final type = kv.key.id;
final content = kv.value;
if (content.isNotEmpty) {
result ??= content;
final path = _CIPath.getChangelogPath(v, type, ln);
await fs.createFile(path, recursive: true);
await fs.writeString(path, content);
}
}
}
printInfo("Release notes written successfully");
return result;
}