listCachedRefs method

List<String> listCachedRefs(
  1. String repoPath
)

Lists all cached refs for a repository

Implementation

List<String> listCachedRefs(String repoPath) {
  final repoCacheDir = getRepositoryCacheDir(repoPath);
  if (!repoCacheDir.existsSync()) {
    return [];
  }

  return repoCacheDir
      .listSync()
      .where((entity) => entity is File && entity.path.endsWith('_api.json'))
      .map((file) => basename(file.path).replaceAll('_api.json', ''))
      .toList();
}