Random changes for an old tool.

This commit is contained in:
Bill Thiede 2021-05-18 09:47:17 -07:00
parent 69eb9d09ec
commit 3b5be0e6d8

View File

@ -38,36 +38,7 @@ func load(dbPath, mdPath string) error {
skipPats := strings.Split(*skipFiles, ",")
glog.Infoln("Skip files", skipPats)
imported, count := 0, 0
if err := filepath.Walk(mdPath, func(path string, info os.FileInfo, err error) error {
base := filepath.Base(path)
if info.IsDir() {
glog.Infoln(path)
for _, pat := range skipPats {
ok, err := filepath.Match(pat, base)
if err != nil {
return err
}
if ok {
return filepath.SkipDir
}
}
}
if !info.Mode().IsRegular() {
return nil
}
for _, pat := range skipPats {
ok, err := filepath.Match(pat, base)
if err != nil {
return err
}
if ok {
return nil
}
}
if err := maildir.Walk(mdPath, func(path string) error {
r, err := os.Open(path)
if err != nil {
return fmt.Errorf("%q open: %v", path, err)