private async Task InstallPlatformAsync(string platformVersion) { if (NeedToInstallPlatform(platformVersion)) { Logger.Info($"Installing platform {platformVersion}"); var platformRelease = await GithubManager.GetPlatformRelease(platformVersion); var platformAssetUrl = platformRelease.Assets.FirstOrDefault().BrowserDownloadUrl; var platformZip = TemporaryDirectory / "platform.zip"; if (string.IsNullOrEmpty(platformAssetUrl)) { ControlFlow.Fail($"No platform's assets found with tag {platformVersion}"); } await HttpTasks.HttpDownloadFileAsync(platformAssetUrl, platformZip); CompressionTasks.Uncompress(platformZip, RootDirectory); } }
public override void Execute(ProjectBuildContext context) { var githubManager = new GithubManager(); context.Template.Version = githubManager.GetVersion(context); context.Template.FilePath = Path.Combine( context.TemplatesFolder, $"{context.Template.Name}-{context.Template.Version}.zip" ); context.Template.RootPathInZipFile = context.Template.GithubRepository.RepositoryName + "-" + context.Template.Version.RemovePreFix("v") + context.Template.RootPathInZipFile; try { githubManager.DownloadIfNotExist(context); } catch (Exception e) { throw e; //TODO: !!! //var existingVersion = githubManager.GetExistingVersion(context); } }
public void InitializeClientWithToken(string token) { Manager = new GithubManager(token); }
public GenerateAppService(GithubManager githubManager, ZipManager zipManager, ReplaceManager replaceManager) { _githubManager = githubManager; _zipManager = zipManager; _replaceManager = replaceManager; }