package structure import ( "os" "path/filepath" "tangled.org/cosmeak.tngl.sh/weave/internal/generator" ) // The idea here is just to get the data from the file, the filename // and then move all this information to the datapack. Nothing fancy // or complicated here. func (s Structure) Emit() (generator.File, error) { path := "data/%namespace%/structure/" + filepath.Base(s.filePath) content, err := os.ReadFile(s.filePath) if err != nil { return generator.File{}, err } return generator.File{ Path: path, Content: content, }, nil }