Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "github.com/gobuffalo/packr"
func init() {
{{- range $box := .Boxes }}
{{- range .Files }}
packr.PackJSONBytes("{{$box.Name}}", "{{.Name}}", "{{.Contents}}")
_ = packr.PackJSONBytes("{{$box.Name}}", "{{.Name}}", "{{.Contents}}")
{{- end }}
{{- end }}
}
Expand Down
24 changes: 12 additions & 12 deletions v2/jam/store/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ var _ Store = &Legacy{}

type Legacy struct {
*Disk
boxes map[string][]legacyBox
boxes map[string][]legacyBox
}

func NewLegacy() *Legacy {
return &Legacy{
Disk: NewDisk("", ""),
boxes: map[string][]legacyBox{},
Disk: NewDisk("", ""),
boxes: map[string][]legacyBox{},
}
}

Expand All @@ -50,8 +50,8 @@ func (l *Legacy) Pack(box *parser.Box) error {

lbs := l.boxes[box.PackageDir]
lbs = append(lbs, legacyBox{
Box: box,
Files: fcs,
Box: box,
Files: fcs,
})
l.boxes[box.PackageDir] = lbs
return nil
Expand All @@ -78,8 +78,8 @@ func (l *Legacy) Close() error {
bx := b[0].Box
pkg := bx.Package
opts := map[string]interface{}{
"Package": pkg,
"Boxes": b,
"Package": pkg,
"Boxes": b,
}
p := filepath.Join(bx.PackageDir, "a_"+bx.Package+"-packr.go.tmpl")
tmpl, err := template.New(p).Parse(legacyTmpl)
Expand All @@ -102,13 +102,13 @@ func (l *Legacy) Close() error {
}

type legacyBox struct {
Box *parser.Box
Files []legacyFile
Box *parser.Box
Files []legacyFile
}

type legacyFile struct {
Name string
Contents string
Name string
Contents string
}

var legacyTmpl = `// Code generated by github.com/gobuffalo/packr. DO NOT EDIT.
Expand All @@ -122,7 +122,7 @@ import "github.com/gobuffalo/packr"
func init() {
{{- range $box := .Boxes }}
{{- range $box.Files }}
packr.PackJSONBytes("{{$box.Box.Name}}", "{{.Name}}", "{{.Contents}}")
_ = packr.PackJSONBytes("{{$box.Box.Name}}", "{{.Name}}", "{{.Contents}}")
{{- end }}
{{- end }}
}
Expand Down