예제 #1
0
        public static (bool, Version) Check(string user, string repository, Version currentVersion)
        {
            try
            {
                var gitHub = new GitHubApi();
                latestReleaseJson = gitHub.GetLatestReleaseJSONAsync(user, repository).Result;
                var version = GitHubApi.ExtractVersion(latestReleaseJson);

                return(currentVersion < version, version);
            }
            catch (Exception)
            {
                return(false, new Version());
            }
        }
예제 #2
0
        public static async Task <(bool, Version)> CheckAsync(string user, string repository, Version currentVersion)
        {
            try
            {
                var gitHub = new GitHubApi();
                latestReleaseJson = await gitHub.GetLatestReleaseJSONAsync(user, repository);

                var version = GitHubApi.ExtractVersion(latestReleaseJson);

                return(currentVersion < version, version);
            }
            catch
            {
                return(false, new Version());
            }
        }