Esempio n. 1
0
        public void Run()
        {
            _runningProcesses.Clear();

            while (true)
            {
                var input = ReadLine.Read("Enter project name or command:\n> ");

                var command = _basicCommandsLookup[input];
                if (command != null)
                {
                    var breakLoop = command.Run(input, _context);
                    if (breakLoop)
                    {
                        break;
                    }
                }
                else
                {
                    var selectedProject = _solutionManager.FindProject(input);
                    if (selectedProject == null)
                    {
                        Console.WriteLine("Project or command not found.");
                        continue;
                    }

                    // Build and run.
                    if (selectedProject.BuildActionNeeded)
                    {
                        Console.Write("Build required. ");

                        if (ReadLineTools.Confirm("Run build?"))
                        {
                            _solutionManager.BuildSolution();
                            Console.WriteLine("Solution built. ");
                        }
                        else
                        {
                            Console.WriteLine($"Building '{selectedProject.Name}'");
                        }
                    }

                    var process = selectedProject.Run();
                    _runningProcesses.Add(process);
                }
            }
        }