diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-12-14 12:20:13 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-12-14 13:51:06 +0100 |
commit | ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37 (patch) | |
tree | 34d88705ab22e5b54949a6ce48e028b1fc2ab7e6 /helpers | |
parent | 87e898a17a52b5338bc9d554dd12b99a54aa2431 (diff) | |
download | hugo-ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37.tar.gz hugo-ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37.zip |
Also consider wrapped errors when checking for file IsNotExist errors
Fixes #10534
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/path.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helpers/path.go b/helpers/path.go index 0fb365f43..ad2ff7658 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -24,6 +24,7 @@ import ( "strings" "unicode" + "github.com/gohugoio/hugo/common/herrors" "github.com/gohugoio/hugo/common/text" "github.com/gohugoio/hugo/config" @@ -378,7 +379,7 @@ func OpenFileForWriting(fs afero.Fs, filename string) (afero.File, error) { // os.Create will create any new files with mode 0666 (before umask). f, err := fs.Create(filename) if err != nil { - if !os.IsNotExist(err) { + if !herrors.IsNotExist(err) { return nil, err } if err = fs.MkdirAll(filepath.Dir(filename), 0777); err != nil { // before umask |