mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-31 12:01:11 +00:00
Do not panic on permission denied
Replace panic with FATAL logging and graceful shutdown. Fixes #837
This commit is contained in:
parent
8ad4fd05d8
commit
251f5e9d40
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"github.com/spf13/afero"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"github.com/spf13/viper"
|
||||
"io"
|
||||
"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
|
||||
if err != nil {
|
||||
if err != os.ErrExist {
|
||||
panic(err)
|
||||
jww.FATAL.Fatalln(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue