diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-12-14 12:20:13 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-12-14 13:51:06 +0100 |
commit | ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37 (patch) | |
tree | 34d88705ab22e5b54949a6ce48e028b1fc2ab7e6 /hugolib/site.go | |
parent | 87e898a17a52b5338bc9d554dd12b99a54aa2431 (diff) |
Also consider wrapped errors when checking for file IsNotExist errors
Fixes #10534
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index cbfc4d836..8fb39a1ea 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -20,7 +20,6 @@ import ( "log" "mime" "net/url" - "os" "path" "path/filepath" "regexp" @@ -30,6 +29,7 @@ import ( "strings" "time" + "github.com/gohugoio/hugo/common/herrors" "github.com/gohugoio/hugo/common/htime" "github.com/gohugoio/hugo/common/hugio" "github.com/gohugoio/hugo/common/types" @@ -90,16 +90,16 @@ import ( // // 1. A list of Files is parsed and then converted into Pages. // -// 2. Pages contain sections (based on the file they were generated from), -// aliases and slugs (included in a pages frontmatter) which are the -// various targets that will get generated. There will be canonical -// listing. The canonical path can be overruled based on a pattern. +// 2. Pages contain sections (based on the file they were generated from), +// aliases and slugs (included in a pages frontmatter) which are the +// various targets that will get generated. There will be canonical +// listing. The canonical path can be overruled based on a pattern. // -// 3. Taxonomies are created via configuration and will present some aspect of -// the final page and typically a perm url. +// 3. Taxonomies are created via configuration and will present some aspect of +// the final page and typically a perm url. // -// 4. All Pages are passed through a template based on their desired -// layout based on numerous different elements. +// 4. All Pages are passed through a template based on their desired +// layout based on numerous different elements. // // 5. The entire collection of files is written to disk. type Site struct { @@ -954,7 +954,7 @@ func (s *Site) filterFileEvents(events []fsnotify.Event) []fsnotify.Event { // Throw away any directories isRegular, err := s.SourceSpec.IsRegularSourceFile(ev.Name) - if err != nil && os.IsNotExist(err) && (ev.Op&fsnotify.Remove == fsnotify.Remove || ev.Op&fsnotify.Rename == fsnotify.Rename) { + if err != nil && herrors.IsNotExist(err) && (ev.Op&fsnotify.Remove == fsnotify.Remove || ev.Op&fsnotify.Rename == fsnotify.Rename) { // Force keep of event isRegular = true } |