예제 #1
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result.ToLower())
            {
            case "y":
                Console.WriteLine("GitFlow is likely a good fit, the 'develop' branch can be used " +
                                  "for active development while stabilising the next release.");
                Console.WriteLine();
                Console.WriteLine("GitHubFlow is designed for a lightweight workflow where master is always " +
                                  "good to deploy to production and feature branches are used to stabilise " +
                                  "features, once stable they are merged to master and made available in the next release");
                steps.Enqueue(new PickBranchingStrategyStep());
                return(StepResult.Ok());

            case "n":
                steps.Enqueue(new PickBranchingStrategy3Step());
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
예제 #2
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "1":
                steps.Enqueue(new GitFlowSetupStep());
                break;

            case "2":
                steps.Enqueue(new GitHubFlowStep());
                break;

            case "3":
                steps.Enqueue(new PickBranchingStrategy1Step());
                break;

            default:
                return(StepResult.InvalidResponseSelected());
            }

            return(StepResult.Ok());
        }
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result.ToLower())
            {
            case "y":
                Console.WriteLine("GitFlow could be a better fit than GitHubFlow for you.");
                Console.WriteLine();
                Console.WriteLine("GitVersion increments the SemVer for each commit on the develop branch by default, " +
                                  "this means all packages built from develop can be published to a single NuGet feed.");
                break;

            case "n":
                Console.WriteLine("We recommend the GitHubFlow branching strategy, it sounds like you will " +
                                  "not benefit from the additional complexity that GitFlow introduces");
                break;

            default:
                return(StepResult.InvalidResponseSelected());
            }

            steps.Enqueue(new PickBranchingStrategyStep());
            return(StepResult.Ok());
        }
예제 #4
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "0":
                return(StepResult.SaveAndExit());

            case "1":
                return(StepResult.ExitWithoutSaving());

            case "2":
                steps.Enqueue(new ConfigureBranches());
                return(StepResult.Ok());

            case "3":
                steps.Enqueue(new GlobalModeSetting(new EditConfigStep(), false));
                return(StepResult.Ok());

            case "4":
                steps.Enqueue(new AssemblyVersioningSchemeSetting());
                return(StepResult.Ok());
            }
            return(StepResult.Ok());
        }
예제 #5
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            int parsed;

            if (int.TryParse(result, out parsed))
            {
                if (parsed == 0)
                {
                    steps.Enqueue(new EditConfigStep());
                    return(StepResult.Ok());
                }

                try
                {
                    var foundBranch = OrderedBranches(config).ElementAt(parsed - 1);
                    steps.Enqueue(new ConfigureBranch(foundBranch.Key, foundBranch.Value));
                    return(StepResult.Ok());
                }
                catch (ArgumentOutOfRangeException)
                { }
            }

            return(StepResult.InvalidResponseSelected());
        }
예제 #6
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            if (string.IsNullOrWhiteSpace(result))
            {
                return(StepResult.InvalidResponseSelected());
            }

            switch (result)
            {
            case "0":
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            case "1":
                branchConfig.Tag = string.Empty;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            default:
                branchConfig.Tag = result;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());
            }
        }