patches method
The patch files in the patch directory.
Implementation
List<PatchFile> patches() {
List<PatchFile> under(String folder, {required bool isGit}) {
final directory = Directory(p.join(patchPath, folder));
if (!directory.existsSync()) {
return const [];
}
return [
for (final entity in directory.listSync())
if (entity is File && entity.path.endsWith('.patch'))
PatchFile(file: entity, isGit: isGit),
]..sort((a, b) => a.folder.compareTo(b.folder));
}
return [...under('hosted', isGit: false), ...under('git', isGit: true)];
}