publish method

Future<void> publish(
  1. AgentLinkAnnouncement announcement
)

Implementation

Future<void> publish(final AgentLinkAnnouncement announcement) async {
  await root.create(recursive: true);
  final file = fileFor(announcement.protocolScheme);
  final temporary = File('${file.path}.tmp');
  await temporary.writeAsString(
    '${jsonEncode(announcement.toJson())}\n',
    flush: true,
  );
  await temporary.rename(file.path);
}