public void Preview(TemplatePlanContext context) { Console.WriteLine("Template plan for {0}", context.Input.ProjectName); Steps .Each(step => { var description = step.Describe(context); if (description.IsNotEmpty()) { Console.WriteLine("* {0}", description); } }); }
public void Preview(TemplatePlanContext context) { Console.WriteLine("Template plan for {0}", context.Input.ProjectName); Steps .Each(step => { var description = step.Describe(context); if(description.IsNotEmpty()) { Console.WriteLine("* {0}", description); } }); }
public void Execute(NewCommandInput input, TemplatePlan plan, Action <TemplatePlanContext> continuation) { var context = new TemplatePlanContext { Input = input, TempDir = createTempDir() }; _fileSystem.CreateDirectory(context.TempDir); var targetPath = input.ProjectName; if (input.OutputFlag.IsNotEmpty()) { targetPath = input.OutputFlag; } else if (input.SolutionFlag.IsNotEmpty()) { targetPath = _fileSystem.GetDirectory(input.SolutionFlag); } context.TargetPath = Path.Combine(Environment.CurrentDirectory, targetPath); plan.Preview(context); try { plan .Steps .Each(step => step.Execute(context)); } catch (Exception exc) { context.RegisterError(exc.Message); context.RegisterError(exc.StackTrace); } continuation(context); _fileSystem.DeleteDirectory(context.TempDir); }
public void Execute(NewCommandInput input, TemplatePlan plan, Action<TemplatePlanContext> continuation) { var context = new TemplatePlanContext { Input = input, TempDir = createTempDir() }; _fileSystem.CreateDirectory(context.TempDir); var targetPath = input.ProjectName; if(input.OutputFlag.IsNotEmpty()) { targetPath = input.OutputFlag; } else if(input.SolutionFlag.IsNotEmpty()) { targetPath = _fileSystem.GetDirectory(input.SolutionFlag); } context.TargetPath = Path.Combine(Environment.CurrentDirectory, targetPath); plan.Preview(context); try { plan .Steps .Each(step => step.Execute(context)); } catch (Exception exc) { context.RegisterError(exc.Message); context.RegisterError(exc.StackTrace); } continuation(context); _fileSystem.DeleteDirectory(context.TempDir); }
public void Execute(TemplatePlanContext context) { }
public string Describe(TemplatePlanContext context) { return ""; }