mirror of https://github.com/perkeep/perkeep.git
Merge "Don't rebuild file embeds if they haven't changed."
This commit is contained in:
commit
6e33d64078
18
make.go
18
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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue