Octokit 允许我轻松检索给定文件夹中的文件列表,如下所示:
var directoryContent = await _githubClient.Repository.Content.GetAllContents("MyUsername", "MyProject", "TheFolderName").ConfigureAwait(false);
不幸的是,Content
每个文件的属性null
意味着我必须遍历文件列表并分别检索每个文件,如下所示:
foreach (var file in directoryContent)
{
var fileWithContent = await _githubClient.Repository.Content.GetAllContents("MyUsername", "MyProject", file.Path).ConfigureAwait(false);
... do something with the content ...
}
有没有更有效的方法来获取给定文件夹中所有文件的内容?