resource: Use the correct Destination FS

Source and destination will be the same when this happens, but it should be correct.

See #4202
This commit is contained in:
Bjørn Erik Pedersen 2018-01-01 14:28:19 +01:00
parent 16e1d99c6d
commit a54fd7df21
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F

View File

@ -414,7 +414,7 @@ func (i *Image) copyToDestination(src string) error {
if err != nil && os.IsNotExist(err) {
// When called from shortcodes, the target directory may not exist yet.
// See https://github.com/gohugoio/hugo/issues/4202
if err = i.spec.Fs.Source.MkdirAll(filepath.Dir(target), os.FileMode(0755)); err != nil {
if err = i.spec.Fs.Destination.MkdirAll(filepath.Dir(target), os.FileMode(0755)); err != nil {
res = err
return
}