Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

            System.Windows.Forms.Application.EnableVisualStyles();

            //Prevent crash that occurs when this dll is not present
            if (!File.Exists(System.Windows.Forms.Application.StartupPath + "/Octokit.dll"))
            {
                MessageBox.Show("Unable to find Octokit.dll.");
                return;
            }

            bool somethingDone = false;

            if (args.Length > 0)
            {
                switch (args[0])
                {
                case "-r":     //overwrite
                    somethingDone = true;
                    Task t = Updater.UpdateCheck(true);
                    t.Wait();
                    break;

                case "-bu":     //brawlbox update call
                    somethingDone = true;
                    Task t2 = Updater.CheckUpdates(args[1], args[2] != "0");
                    t2.Wait();
                    break;

                case "-bi":     //brawlbox issue call
                    somethingDone = true;
                    Task t3 = BugSquish.CreateIssue(args[1], args[2], args[3], args[4], args[5]);
                    t3.Wait();
                    break;
                }
            }
            else if (args.Length == 0)
            {
                somethingDone = true;
                Task t = Updater.UpdateCheck();
                t.Wait();
            }

            if (!somethingDone)
            {
                Console.WriteLine(Usage);
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            bool somethingDone = false;

            if (args.Length > 0)
            {
                switch (args[0])
                {
                case "-r":     //overwrite
                    somethingDone = true;
                    Task t = Updater.UpdateCheck(true);
                    t.Wait();
                    break;

                case "-bu":     //brawlbox update call
                    somethingDone = true;
                    Task t2 = Updater.CheckUpdates(args[1], args[2] != "0");
                    t2.Wait();
                    break;

                case "-bi":     //brawlbox issue call
                    somethingDone = true;
                    Task t3 = BugSquish.CreateIssue(args[1], args[2], args[3], args[4], args[5]);
                    t3.Wait();
                    break;
                }
            }
            else if (args.Length == 0)
            {
                somethingDone = true;
                Task t = Updater.UpdateCheck();
                t.Wait();
            }

            if (!somethingDone)
            {
                Console.WriteLine(Usage);
            }
        }
Ejemplo n.º 3
0
        private static void Main(string[] args)
        {
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

            Application.EnableVisualStyles();

            //Prevent crash that occurs when this dll is not present
            if (!File.Exists(Application.StartupPath + "/Octokit.dll"))
            {
                MessageBox.Show("Unable to find Octokit.dll.");
                return;
            }

            bool somethingDone = false;

            Updater.currentRepo   = Updater.GetCurrentRepo();
            Updater.currentBranch = Updater.GetCurrentBranch();
            if (args.Length > 0)
            {
                switch (args[0])
                {
                case "-r":     //overwrite
                    somethingDone = true;
                    Task t = Updater.CheckUpdate(true);
                    t.Wait();
                    break;

                case "-n":     // Update in new folder
                    somethingDone = true;
                    Task t1 = Updater.CheckUpdate(false);
                    t1.Wait();
                    break;

                case "-bu":     //BrawlCrate update call
                    somethingDone = true;
                    Task t2 = Updater.CheckUpdate(args[1] != "0", args[2], args[3] != "0", args[4], args[5] != "0",
                                                  args[6] != "0");
                    t2.Wait();
                    break;

                case "-buc":     //BrawlCrate Canary update call
                    somethingDone = true;
                    Task t2c = Updater.CheckCanaryUpdate(args[1], args[2] != "0");
                    t2c.Wait();
                    break;

                case "-bi":     //BrawlCrate issue call
                    somethingDone = true;
                    Task t3 = BugSquish.CreateIssue(args[1], args[2], args[3], args[4], args[5]);
                    t3.Wait();
                    break;

                case "-bcommitTime":     //Called on build to ensure time is saved
                    somethingDone = true;
                    string t4arg1 = null, t4arg2 = null, t4arg3 = null;
                    if (args.Length > 1)
                    {
                        t4arg1 = args[1];
                        if (args.Length > 2)
                        {
                            t4arg2 = args[2];
                            if (args.Length > 3)
                            {
                                t4arg3 = args[3];
                            }
                        }
                    }

                    Task t4 = Updater.WriteCanaryTime(t4arg1, t4arg2, t4arg3);
                    t4.Wait();
                    break;

                case "-dlCanary":     // Force download the latest Canary build
                    somethingDone = true;
                    Task t5a = Updater.SetCanaryActive();
                    t5a.Wait();
                    Task t5 = Updater.CheckCanaryUpdate(args.Length > 1 ? args[1] : null, false, true);
                    t5.Wait();
                    break;

                case "-dlStable":     // Force download the latest Stable build
                    somethingDone = true;
                    Task t6a = Updater.SetCanaryInactive();
                    t6a.Wait();
                    Task t6 = Updater.ForceDownloadStable(args.Length > 1 ? args[1] : null);
                    t6.Wait();
                    break;

                case "-dlDoc":     // Force download the latest Documentation build
                    somethingDone = true;
                    Task t6d = Updater.ForceDownloadDocumentation();
                    t6d.Wait();
                    break;

                case "-canarylog":     // Show changelog for canary
                    somethingDone = true;
                    Task t7 = Updater.ShowCanaryChangelog();
                    t7.Wait();
                    break;

                case "-canaryOn":     // Activate canary build
                    somethingDone = true;
                    Task t8 = Updater.SetCanaryActive();
                    t8.Wait();
                    break;

                case "-canaryOff":
                    somethingDone = true;
                    Task t9 = Updater.SetCanaryInactive();
                    t9.Wait();
                    break;

                case "-killAll":
                    somethingDone = true;
                    Task t10 = Updater.KillOpenWindows();
                    t10.Wait();
                    break;
                }
            }
            else if (args.Length == 0)
            {
                somethingDone = true;
                Task t = Updater.CheckUpdate(true);
                t.Wait();
            }

            if (!somethingDone)
            {
                Console.WriteLine(Usage);
            }
        }