protected override async Task ExecuteCore() { if (Directory.Exists(destination)) { Log.Warning("{Url}{Folder} was already downloaded. Skipping download.", repositoryUrl, relativePath); return; } var branch = await gitHubClient.Repository.Branch.Get(repoInfo.Owner, repoInfo.Repository, branchName); var commit = branch.Commit; var downloadUrl = GitHubMixin.GetCommitDownloadUrl(repositoryUrl, commit.Sha); var downloadeOn = DateTimeOffset.Now; using (var stream = await downloader.GetStream(downloadUrl, progressObserver)) { var relative = repoInfo.Repository + "-" + commit.Sha + "/" + relativePath; await zipExtractor.ExtractRelativeFolder(stream, relative, destination); } SaveMetadata(new { Repository = repoInfo, Commit = commit.Sha, Branch = branch.Name, DownloadedOn = downloadeOn, }); }
public async Task Execute() { if (fileSystemOperations.DirectoryExists(destination)) { Log.Warning("UEFI was already downloaded. Skipping download."); return; } using (var stream = await GitHubMixin.GetBranchZippedStream("https://github.com/andreiw/RaspberryPiPkg", progressObserver: progressObserver)) { await extractor.ExtractRelativeFolder(stream, GetMostRecentDirEntry, destination, progressObserver); } }
public async Task Execute() { if (fileSystemOperations.DirectoryExists(destination)) { Log.Warning("{Url}{Folder} was already downloaded. Skipping download.", url, relativePath); return; } using (var stream = await GitHubMixin.GetBranchZippedStream(downloader, url, progressObserver: progressObserver)) { await zipExtractor.ExtractRelativeFolder(stream, relativePath, destination); } }