func NewContext(gen scaffolt.Generator, target string, log *logrus.Entry) scaffolt.Context { return &context{ target: target, generator: gen, m: dict.NewMap(), l: log, } }
func (self *task) Run(ctx scaffolt.Context) error { ctx.Set(self.desc.Name, dict.NewMap()) ctx = &taskContext{ctx, self.desc.Name} if err := self.runHook(Before, ctx); err != nil { return err } self.l.Printf("Running questions") if err := self.questions.Run(ctx); err != nil { return err } self.l.Printf("Running files") if err := self.runFiles(ctx); err != nil { return err } if err := self.runHook(After, ctx); err != nil { return err } return nil }