diff --git a/make.go b/make.go index 5bff2b523..d01be43ac 100644 --- a/make.go +++ b/make.go @@ -360,19 +360,13 @@ func genEmbeds() error { } // We mark all the zembeds in builddir as wanted, so that we do not // have to regen them next time, unless they need updating. - f, err := os.Open(embeds) - if err != nil { - return err - } - defer f.Close() - names, err := f.Readdirnames(-1) - if err != nil { - return err - } - for _, v := range names { - if strings.HasPrefix(v, "zembed_") { - wantDestFile[filepath.Join(embeds, v)] = true + if err := filepath.Walk(embeds, func(path string, _ os.FileInfo, err error) error { + if strings.HasPrefix(filepath.Base(path), "zembed_") { + wantDestFile[path] = true } + return err + }); err != nil { + return err } } return nil diff --git a/pkg/fileembed/genfileembed/genfileembed.go b/pkg/fileembed/genfileembed/genfileembed.go index 2b2fec2ad..f80ffba6f 100644 --- a/pkg/fileembed/genfileembed/genfileembed.go +++ b/pkg/fileembed/genfileembed/genfileembed.go @@ -108,7 +108,7 @@ func main() { if !genFile() { continue } - log.Printf("Updating %s (package %s)", filepath.Join(dir, embedName), pkgName) + log.Printf("Updating %s (package %s)", embedName, pkgName) bs, err := ioutil.ReadFile(fileName) if err != nil {