mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Handle sync (file copy) errors better)
This commit is contained in:
parent
18a29964fa
commit
ef0b9b511c
1 changed files with 10 additions and 2 deletions
|
@ -331,7 +331,11 @@ func watchConfig() {
|
|||
}
|
||||
|
||||
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 @@ func NewWatcher(port int) error {
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue