Skip to content

Commit

Permalink
Do not ERROR-log missing /data dir
Browse files Browse the repository at this point in the history
Fixes #930
  • Loading branch information
bep committed Mar 12, 2015
1 parent b190ad0 commit fbcda03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,14 @@ func copyStatic() error {
// getDirList provides NewWatcher() with a list of directories to watch for changes.
func getDirList() []string {
var a []string
dataDir := helpers.AbsPathify(viper.GetString("DataDir"))
walker := func(path string, fi os.FileInfo, err error) error {
if err != nil {
if path == dataDir && os.IsNotExist(err) {
jww.WARN.Println("Skip DataDir:", err)
return nil

}
jww.ERROR.Println("Walker: ", err)
return nil
}
Expand Down Expand Up @@ -328,7 +334,7 @@ func getDirList() []string {
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("LayoutDir")), walker)
filepath.Walk(helpers.AbsPathify(viper.GetString("StaticDir")), walker)
Expand Down

0 comments on commit fbcda03

Please sign in to comment.