shithub: hugo

Download patch

ref: ef0b9b511c104422cd1fbd8e6a85fb424ab9b827
parent: 18a29964fad31e51a4aefa4523f6aaf00c829b92
author: spf13 <[email protected]>
date: Mon Nov 16 16:52:37 EST 2015

Handle sync (file copy) errors better)

--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -331,7 +331,11 @@
 }
 
 func build(watches ...bool) {
-	utils.CheckErr(copyStatic(), fmt.Sprintf("Error copying static files to %s", helpers.AbsPathify(viper.GetString("PublishDir"))))
+	err := copyStatic()
+	if err != nil {
+		fmt.Println(err)
+		utils.StopOnErr(err, fmt.Sprintf("Error copying static files to %s", helpers.AbsPathify(viper.GetString("PublishDir"))))
+	}
 	watch := false
 	if len(watches) > 0 && watches[0] {
 		watch = true
@@ -516,7 +520,11 @@
 
 				if staticChanged {
 					jww.FEEDBACK.Printf("Static file changed, syncing\n\n")
-					utils.StopOnErr(copyStatic(), fmt.Sprintf("Error copying static files to %s", helpers.AbsPathify(viper.GetString("PublishDir"))))
+					err := copyStatic()
+					if err != nil {
+						fmt.Println(err)
+						utils.StopOnErr(err, fmt.Sprintf("Error copying static files to %s", helpers.AbsPathify(viper.GetString("PublishDir"))))
+					}
 
 					if !BuildWatch && !viper.GetBool("DisableLiveReload") {
 						// Will block forever trying to write to a channel that nobody is reading if livereload isn't initalized