func (self *Questions) Run(ctx scaffolt.Context) error { for _, q := range self.desc { w := getWidget(q.Name, q, ctx) if w == nil { return fmt.Errorf("No widget: %s", q.Type) } ctx.Set(q.Name, w.Run()) for _, file := range q.Files { ctx.Generator().AddFile(file) } } return nil }
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 }