/// <summary> /// Parses gitApi text and gets the latest release version of the program the gitApi text is for /// </summary> /// <param name="aquiredGitText">The text that was successfully read from github</param> /// <returns>an int of the latest release version, as a whole number without decimals</returns> public static string GetLatestVersion(string aquiredGitText) { var gitApi = GithubReleaseConfig.FromJson(aquiredGitText); string latestRelease = gitApi[0].TagName; return(latestRelease); }
/// <summary> /// Reads gitApi text and gets all of the download urls associated with the latest release /// </summary> /// <returns>a list of download url strings</returns> private List <string> GetDownloadURLs() { int i = -1; List <string> downloads = new List <string>(); var gitApi = GithubReleaseConfig.FromJson(AquiredGitApiText); foreach (var a in gitApi[0].Assets) { i++; if (GitFileIndexsToDownload != null && !GitFileIndexsToDownload.Contains(i)) { continue; } Logger.Log("Downloading " + a.BrowserDownloadUrl.ToString()); downloads.Add(a.BrowserDownloadUrl.ToString()); } return(downloads); }
private List <GithubReleaseConfig> CreateReleaseConfigFromText(string unparsedGitText) { var releaseConfig = GithubReleaseConfig.FromJson(unparsedGitText); return(releaseConfig); }