public override bool Execute(AddInput input) { input.AssertValid(); if (input.ListFlag) { Templating.Library.Graph.FindCategory("add").WriteDescriptionToConsole(); return(true); } var solutionFile = input.SolutionFlag ?? SolutionFinder.FindSolutionFile(); if (solutionFile.IsEmpty()) { return(false); } try { var request = BuildTemplateRequest(input, solutionFile); var plan = Templating.BuildPlan(request); Templating.ExecutePlan(plan); } catch (Exception) { Console.WriteLine("Template planning failed. The valid options for this command are:"); Templating.Library.Graph.FindCategory("add").WriteDescriptionToConsole(); Console.WriteLine(); Console.WriteLine(); throw; } return(true); }
public override bool Execute(NewStorytellerInput input) { // TODO -- duplication here string solutionFile = SolutionFinder.FindSolutionFile(); if (solutionFile == null) { return(false); } var projectRequest = new ProjectRequest(input.Name, "baseline"); projectRequest.AddAlteration("storyteller"); var request = new TemplateRequest { RootDirectory = Environment.CurrentDirectory, SolutionName = solutionFile }; request.AddProjectRequest(projectRequest); // TODO -- add an option to copy references from the parent project var plan = NewCommand.BuildTemplatePlan(request); NewCommand.ExecutePlan(plan); return(true); }
public override bool Execute(EnhanceInput input) { var solutionFile = SolutionFinder.FindSolutionFile(); if (solutionFile == null) { return(false); } var request = BuildTemplateRequest(input, solutionFile); var plan = Templating.BuildPlan(request); plan.Solution = Solution.LoadFrom(solutionFile); Templating.ExecutePlan(plan); return(true); }
public override bool Execute(BottleInput input) { // TODO -- duplication here string solutionFile = SolutionFinder.FindSolutionFile(); if (solutionFile == null) { return(false); } var request = BuildTemplateRequest(input, solutionFile); var plan = NewCommand.BuildTemplatePlan(request); // TODO -- try to add CopyReferences from the parent NewCommand.ExecutePlan(plan, () => initializeTheBottle(input, plan)); return(true); }