Beispiel #1
0
        public async Task Execute()
        {
            if (fileSystemOperations.DirectoryExists(destination))
            {
                Log.Warning("UEFI was already downloaded. Skipping download.");
                return;
            }

            using (var stream = await githubCient.Open("https://github.com/andreiw/RaspberryPiPkg"))
            {
                var zipArchive = await Observable.Start(() => new ZipArchive(stream, ZipArchiveMode.Read));

                var mostRecentFolderEntry = GetMostRecentDirEntry(zipArchive);

                var contents = zipArchive.Entries.Where(x => x.FullName.StartsWith(mostRecentFolderEntry.FullName) && !x.FullName.EndsWith("/"));
                await ExtractContents(mostRecentFolderEntry, contents);
            }
        }