From 1b2da4e18f61d30b3881e356bd390083889776de Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 15 Aug 2021 21:36:08 +0200 Subject: [PATCH] Fix exist method --- file.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/file.go b/file.go index c950a01..a557d2d 100644 --- a/file.go +++ b/file.go @@ -644,12 +644,11 @@ func saveWithGit(fp *FilePages, p string, summary, author string) error { func (fp *FilePages) Exist(p string) bool { pageName := filepath.Join(fp.dirname, strings.Replace(p, " ", "_", -1)) - log.Printf("Exist? %s\n", pageName) _, err := os.Stat(pageName) if err != nil { - return os.IsExist(err) + return !os.IsNotExist(err) } - return false + return true } func DiffPrettyHtml(diffs []diffmatchpatch.Diff) string {