run method

  1. @override
Future<void> run()
override

Builds changelog content from git history and writes it to CHANGELOG.md.

Implementation

@override
/// Builds changelog content from git history and writes it to `CHANGELOG.md`.
Future<void> run() async {
  final dryRun = argResults!['dry-run'] as bool;
  final executor = RealReleaseExecutor();
  final generator = ChangelogGenerator(executor);
  final section = await generator.generateUnreleased();

  if (dryRun) {
    print(section);
    return;
  }

  final service = ChangelogService();
  await service.upsertUnreleased(section);
  print('Updated CHANGELOG.md with Unreleased changes.');
}