localeNotesSource function

NotesSource localeNotesSource(
  1. String changelog,
  2. String locale
)

Where locale's notes come from, given changelog as the default.

A symlink that resolves is an ordinary OwnFile — the same file read twice, if it points at the default — and needs no case of its own.

Implementation

NotesSource localeNotesSource(String changelog, String locale) {
  final path = localeChangelogPath(changelog, locale);
  if (File(path).existsSync()) {
    return OwnFile(path);
  }
  if (FileSystemEntity.typeSync(path, followLinks: false) ==
      FileSystemEntityType.link) {
    return DanglingLink(path);
  }
  return DefaultFile(changelog);
}