From: James Mills <1290234+prologic@users.noreply.github.com> Date: Sat, 18 Mar 2023 07:40:46 +0000 (+1000) Subject: Fix tests X-Git-Tag: 0.2.0~3 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=5b82d79c90f370f3c22cb22d3312609d84230e2a;p=aya.git Fix tests --- diff --git a/main.go b/main.go index eb09672..36cc25e 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ package main import ( "bytes" "context" + "errors" "fmt" "io" "io/ioutil" @@ -520,7 +521,9 @@ func buildAll(ctx context.Context, watch bool) error { 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 @@ -623,7 +626,9 @@ func init() { 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) } diff --git a/testdata/extensions/.test/index.html b/testdata/extensions/.test/index.html index 7dc7db4..ef8cfca 100644 --- a/testdata/extensions/.test/index.html +++ b/testdata/extensions/.test/index.html @@ -2,7 +2,7 @@
Hello World!
diff --git a/testdata/ignore/.test/index.html b/testdata/ignore/.test/index.html index 80b5a0d..417c430 100644 --- a/testdata/ignore/.test/index.html +++ b/testdata/ignore/.test/index.html @@ -1,5 +1,5 @@ -Simple page
diff --git a/testdata/simple/.test/index.html b/testdata/simple/.test/index.html index 80b5a0d..417c430 100644 --- a/testdata/simple/.test/index.html +++ b/testdata/simple/.test/index.html @@ -1,5 +1,5 @@ -Simple page
diff --git a/testdata/variables/.test/index.html b/testdata/variables/.test/index.html index 9307c98..25dfc33 100644 --- a/testdata/variables/.test/index.html +++ b/testdata/variables/.test/index.html @@ -2,7 +2,7 @@Simple page