예제 #1
0
 public static void ShowStatusText()
 {
     Console.WriteLine();
     //Console.WriteLine($"Current working directory: {Environment.CurrentDirectory}");
     //Console.WriteLine();
     Console.WriteLine($"Templates:");
     Console.WriteLine();
     Console.WriteLine($"{TemplateData.GetTempateDataOutput()}");
     Console.WriteLine();
     Console.WriteLine($"Commands: help, add, new");
     Console.WriteLine();
     Console.WriteLine($"{OutputText.HelpAdd}");
     Console.WriteLine();
     Console.WriteLine($"{OutputText.HelpNew}");
     Console.WriteLine();
 }
예제 #2
0
        public void Execute(string[] args)
        {
            model = ProcessArgs(args);

            if (model.ShowHelp)
            {
                Console.WriteLine();
                Console.WriteLine(OutputText.HelpAdd);
                var o = TemplateData.GetTempateDataOutput();
                Console.WriteLine(o);
                Console.WriteLine();
            }
            else if (model.IsValid())
            {
                //patchApplicationService.AddAureliaToProject(model.TemplateId, model.TemplateRoot);
                var ti = TemplateData.AllTemplates.Where(x => x.TemplateId == model.TemplateId).SingleOrDefault();
                if (ti != null)
                {
                    patchApplicationService.AddAureliaToProject(ti, model.TemplateRoot);
                }
                else
                {
                    Console.WriteLine("Error! No template item found...");
                }

                Console.WriteLine();
                Console.WriteLine("Installing Aurelia...");
                Console.WriteLine();

                try
                {
                    //TODO: make cross platform
                    if (model.HasPostBuildAction)
                    {
                        if (model.TemplateId == 1)
                        {
                            BuildAndRunAureliaApp(model).WaitForExit();
                        }

                        if (model.TemplateId == 2)
                        {
                            BuildAndRunAureliaAppVS(model).WaitForExit();
                        }

                        if (model.TemplateId == 3)
                        {
                            BuildAndRunAureliaAppVS(model).WaitForExit();
                        }
                    }
                }
                catch (Exception ex)
                {
                    var exx = ex;
                }

                Console.WriteLine();
                Console.WriteLine(OutputText.AureliaIsReady);
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine();
                Console.WriteLine($"Error parsing arguments for command: {model.ErrorMessage}{Environment.NewLine}Please check and try again.");
                Console.WriteLine();
            }
        }