public void Run()
        {
            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("Create default web project");
            CLIConsole.WriteSeparator();


            string directory;

            while (true)
            {
                var(isQuit, input) = Prompt.ShowQuitable("directory:");
                if (isQuit)
                {
                    CLIConsole.WriteLine("aborted", ConsoleColor.Red);
                    return;
                }

                if (Directory.Exists(input))
                {
                    directory = input;
                    break;
                }

                CLIConsole.WriteLine("directory not found.");
            }

            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("The following WebProject will be created:");
            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("directory:");
            CLIConsole.WriteLine("- " + directory);

            var yesno = Prompt.ShowYesNoPrompt("Look okay?");

            if (yesno == YesNoPrompt.Result.Yes)
            {
                createWebProject(directory);
                CLIConsole.WriteLine("done.");
            }
            else
            {
                CLIConsole.WriteLine("end.");
            }
            CLIConsole.WriteLine();
        }
示例#2
0
        public void Run()
        {
            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("Create UseCase");
            CLIConsole.WriteSeparator();

            if (!CheckSetting(context))
            {
                showAbort();
                return;
            }

            var controllerName = Prompt.Show("controller name:");
            var actionName     = Prompt.Show("action name:");

            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("The following UseCase will be created:");
            CLIConsole.WriteSeparator();
            CLIConsole.WriteLine("directory:");
            CLIConsole.WriteLine("- " + setting.WebProjectDirectoryPath);
            CLIConsole.WriteLine("controller name:");
            CLIConsole.WriteLine("- " + controllerName);
            CLIConsole.WriteLine("action name:");
            CLIConsole.WriteLine("- " + actionName);
            CLIConsole.WriteSeparator();

            var yesno = Prompt.ShowYesNoPrompt("Look okay?");

            if (yesno == YesNoPrompt.Result.No)
            {
                showAbort();
                return;
            }

            var rootFullPath = new Uri(new Uri(setting.WebProjectDirectoryPath), ".").AbsolutePath;
            var param        = new CreateUseCaseTaskParameter(rootFullPath, setting.WebProjectDirectoryPath, controllerName, actionName);
            var task         = new CreateUseCaseTask();

            task.Run(param);

            CLIConsole.WriteLine();
            CLIConsole.WriteLine("CreateUseCase done.");
            CLIConsole.WriteLine();
        }