Add resources.Copy

Implemented by most Resource objects, but not Page (for now).

Fixes #9313
This commit is contained in:
Bjørn Erik Pedersen
2022-05-24 09:34:36 +02:00
parent 6f7fbe03b1
commit cd0112a05a
8 changed files with 169 additions and 13 deletions

View File

@@ -33,8 +33,6 @@ import (
"github.com/mitchellh/hashstructure"
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/common/hugo"
"github.com/spf13/afero"
@@ -521,13 +519,7 @@ func PrintFs(fs afero.Fs, path string, w io.Writer) {
}
afero.Walk(fs, path, func(path string, info os.FileInfo, err error) error {
var filename string
var meta any
if fim, ok := info.(hugofs.FileMetaInfo); ok {
filename = fim.Meta().Filename
meta = fim.Meta()
}
fmt.Fprintf(w, " %q %q\t\t%v\n", path, filename, meta)
fmt.Println(path)
return nil
})
}