mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-30 01:43:32 -05:00
parent
b190ad0ff9
commit
fbcda03029
1 changed files with 7 additions and 1 deletions
|
@ -295,8 +295,14 @@ func copyStatic() error {
|
||||||
// getDirList provides NewWatcher() with a list of directories to watch for changes.
|
// getDirList provides NewWatcher() with a list of directories to watch for changes.
|
||||||
func getDirList() []string {
|
func getDirList() []string {
|
||||||
var a []string
|
var a []string
|
||||||
|
dataDir := helpers.AbsPathify(viper.GetString("DataDir"))
|
||||||
walker := func(path string, fi os.FileInfo, err error) error {
|
walker := func(path string, fi os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if path == dataDir && os.IsNotExist(err) {
|
||||||
|
jww.WARN.Println("Skip DataDir:", err)
|
||||||
|
return nil
|
||||||
|
|
||||||
|
}
|
||||||
jww.ERROR.Println("Walker: ", err)
|
jww.ERROR.Println("Walker: ", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -328,7 +334,7 @@ func getDirList() []string {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
filepath.Walk(helpers.AbsPathify(viper.GetString("DataDir")), walker)
|
filepath.Walk(dataDir, walker)
|
||||||
filepath.Walk(helpers.AbsPathify(viper.GetString("ContentDir")), walker)
|
filepath.Walk(helpers.AbsPathify(viper.GetString("ContentDir")), walker)
|
||||||
filepath.Walk(helpers.AbsPathify(viper.GetString("LayoutDir")), walker)
|
filepath.Walk(helpers.AbsPathify(viper.GetString("LayoutDir")), walker)
|
||||||
filepath.Walk(helpers.AbsPathify(viper.GetString("StaticDir")), walker)
|
filepath.Walk(helpers.AbsPathify(viper.GetString("StaticDir")), walker)
|
||||||
|
|
Loading…
Reference in a new issue