mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-15 03:14:02 +00:00
hugolib: Fix livereload problem with files including NFC characters in MacOs
Fixes #8429
This commit is contained in:
parent
74f0777c5f
commit
d82cef5c53
1 changed files with 6 additions and 0 deletions
|
@ -24,12 +24,14 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gohugoio/hugo/common/types"
|
"github.com/gohugoio/hugo/common/types"
|
||||||
|
"golang.org/x/text/unicode/norm"
|
||||||
|
|
||||||
"github.com/gohugoio/hugo/common/paths"
|
"github.com/gohugoio/hugo/common/paths"
|
||||||
|
|
||||||
|
@ -950,6 +952,10 @@ func (s *Site) filterFileEvents(events []fsnotify.Event) []fsnotify.Event {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS == "darwin" { // When a file system is HFS+, its filepath is in NFD form.
|
||||||
|
ev.Name = norm.NFC.String(ev.Name)
|
||||||
|
}
|
||||||
|
|
||||||
filtered = append(filtered, ev)
|
filtered = append(filtered, ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue