import (
"bytes"
"context"
+ "errors"
"fmt"
"io"
"io/ioutil"
filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
// rebuild if changes to .zs/ or .zsignore
if (filepath.Base(path) == ZSIGNORE || filepath.Dir(path) == ZSDIR) && info.ModTime().After(lastModified) {
- Ignore = ParseIgnoreFile(path)
+ if filepath.Base(path) == ZSIGNORE {
+ Ignore = ParseIgnoreFile(path)
+ }
// reset lastModified to 0 so everything rebuidls
lastModified = time.Unix(0, 0)
return nil
func ParseIgnoreFile(fn string) *ignore.GitIgnore {
obj, err := ignore.CompileIgnoreFile(ZSIGNORE)
if err != nil {
- log.WithError(err).Warnf("error parsing .zsignore: %s (using defaults)s", fn)
+ if !errors.Is(err, os.ErrNotExist) {
+ log.WithError(err).Warnf("error parsing .zsignore: %s (using defaults)s", fn)
+ }
return ignore.CompileIgnoreLines(DefaultIgnore)
}