mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 16:55:11 +01:00
Have "wuffs gen" skip duplicate packages
This commit is contained in:
1 parent
7b98b785f2
commit
a255958b41
1 file changed
+8
@@ -69,9 +69,17 @@ type genHelper struct {
|
|||||||
wuffsRoot string
|
wuffsRoot string
|
||||||
langs []string
|
langs []string
|
||||||
affected []string
|
affected []string
|
||||||
|
seen map[string]struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *genHelper) gen(dirname string, recursive bool) error {
|
func (h *genHelper) gen(dirname string, recursive bool) error {
|
||||||
|
if h.seen == nil {
|
||||||
|
h.seen = map[string]struct{}{}
|
||||||
|
} else if _, ok := h.seen[dirname]; ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
h.seen[dirname] = struct{}{}
|
||||||
|
|
||||||
filenames, dirnames, err := listDir(h.wuffsRoot, dirname, recursive)
|
filenames, dirnames, err := listDir(h.wuffsRoot, dirname, recursive)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user