Beispiel #1
0
        private static void CheckUpdate(UpdateOptions options)
        {
            var update = new UpdateDownloader(options);

            // Exit if check only is true
            if (options.CheckOnly)
            {
                Environment.Exit(update.IsUpToDate() ? 201 : 200);
            }

            if (update.IsUpToDate())
            {
                Environment.Exit(5);                      // Download only if new version is available. 5 means no updates
            }
            // Download files
            update.DownloadPackage(new Uri(update.LatestRelease.Assets[0].BrowserDownloadUrl));

            // Writes Json package info
            update.WritePackageJson();
        }