mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Do not panic on permission denied
Replace panic with FATAL logging and graceful shutdown. Fixes #837
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
|
jww "github.com/spf13/jwalterweatherman"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@@ -391,7 +392,7 @@ func WriteToDisk(inpath string, r io.Reader, fs afero.Fs) (err error) {
|
|||||||
err = fs.MkdirAll(ospath, 0777) // rwx, rw, r
|
err = fs.MkdirAll(ospath, 0777) // rwx, rw, r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != os.ErrExist {
|
if err != os.ErrExist {
|
||||||
panic(err)
|
jww.FATAL.Fatalln(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user