shithub: hugo

Download patch

ref: 251f5e9d40916779f9d76dcf213f4ddf16b7786b
parent: 8ad4fd05d8dff450c8ceffd58483497d9f0e6d88
author: bep <[email protected]>
date: Tue Jan 27 11:51:24 EST 2015

Do not panic on permission denied

Replace panic with FATAL logging and graceful shutdown.

Fixes #837

--- a/helpers/path.go
+++ b/helpers/path.go
@@ -17,6 +17,7 @@
 	"errors"
 	"fmt"
 	"github.com/spf13/afero"
+	jww "github.com/spf13/jwalterweatherman"
 	"github.com/spf13/viper"
 	"io"
 	"os"
@@ -391,7 +392,7 @@
 		err = fs.MkdirAll(ospath, 0777) // rwx, rw, r
 		if err != nil {
 			if err != os.ErrExist {
-				panic(err)
+				jww.FATAL.Fatalln(err)
 			}
 		}
 	}