Fix exist method
This commit is contained in:
parent
81f3047829
commit
1b2da4e18f
5
file.go
5
file.go
|
@ -644,12 +644,11 @@ func saveWithGit(fp *FilePages, p string, summary, author string) error {
|
||||||
|
|
||||||
func (fp *FilePages) Exist(p string) bool {
|
func (fp *FilePages) Exist(p string) bool {
|
||||||
pageName := filepath.Join(fp.dirname, strings.Replace(p, " ", "_", -1))
|
pageName := filepath.Join(fp.dirname, strings.Replace(p, " ", "_", -1))
|
||||||
log.Printf("Exist? %s\n", pageName)
|
|
||||||
_, err := os.Stat(pageName)
|
_, err := os.Stat(pageName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return os.IsExist(err)
|
return !os.IsNotExist(err)
|
||||||
}
|
}
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func DiffPrettyHtml(diffs []diffmatchpatch.Diff) string {
|
func DiffPrettyHtml(diffs []diffmatchpatch.Diff) string {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user