fix gophermap file sections to be gophermap formatted

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
master
kim (grufwub) 4 years ago
parent 6009e56337
commit c7c0936a48

@ -189,8 +189,17 @@ func (s *FileSection) RenderAndWrite(client *core.Client) core.Error {
return err
}
// Read the file contents into memory
b, err := core.FileSystem.ReadFile(fd)
// Byte slice to contain gophermap contents
b := make([]byte, 0)
// Scan the file contents, format for gophermap, append to byte slice
err = core.FileSystem.ScanFile(
fd,
func(line string) bool {
b = append(b, buildInfoLine(line)...)
return true
},
)
if err != nil {
return err
}

Loading…
Cancel
Save