github.com/res-am/buffalo@v0.11.1/generators/refresh/refresh.go (about)

     1  package refresh
     2  
     3  import (
     4  	"github.com/gobuffalo/buffalo/generators"
     5  	"github.com/gobuffalo/makr"
     6  	"github.com/gobuffalo/packr"
     7  	"github.com/pkg/errors"
     8  )
     9  
    10  // Run generator for a .buffalo.dev.yml file
    11  func Run(root string, data makr.Data) error {
    12  	g := makr.New()
    13  
    14  	files, err := generators.FindByBox(packr.NewBox("../refresh/templates"))
    15  	if err != nil {
    16  		return errors.WithStack(err)
    17  	}
    18  
    19  	for _, f := range files {
    20  		g.Add(makr.NewFile(f.WritePath, f.Body))
    21  	}
    22  
    23  	return g.Run(root, data)
    24  }