Log fsync errors - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 80e1fd29ab52a608d3f8359b8775b975bf3b59e5
DIR parent 5b065a27a26fbc70a5383d48b4657bebd4ab5ed5
HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Tue, 1 Mar 2016 16:38:56 +0100
Log fsync errors
Diffstat:
M commands/hugo.go | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
DIR diff --git a/commands/hugo.go b/commands/hugo.go
@@ -847,7 +847,9 @@ func NewWatcher(port int) error {
} else if err == nil {
// If file still exists, sync it
logger.Println("Syncing", relPath, "to", publishDir)
- syncer.Sync(filepath.Join(publishDir, relPath), relPath)
+ if err := syncer.Sync(filepath.Join(publishDir, relPath), relPath); err != nil {
+ jww.ERROR.Println(err)
+ }
} else {
jww.ERROR.Println(err)
}
@@ -857,7 +859,9 @@ func NewWatcher(port int) error {
// For all other event operations Hugo will sync static.
logger.Println("Syncing", relPath, "to", publishDir)
- syncer.Sync(filepath.Join(publishDir, relPath), relPath)
+ if err := syncer.Sync(filepath.Join(publishDir, relPath), relPath); err != nil {
+ jww.ERROR.Println(err)
+ }
}
}