mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-07 16:33:29 +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"
|
"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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue