builds now

This commit is contained in:
2022-12-02 01:31:49 +01:00
parent 4ac80cfcec
commit 5c76824e14
11 changed files with 153 additions and 112 deletions

46
mfer/manifest.go Normal file
View File

@@ -0,0 +1,46 @@
package mfer
import (
"io"
"io/fs"
"github.com/spf13/afero"
)
type ManifestFile struct {
Path string
FileInfo fs.FileInfo
}
type Manifest struct {
SourceFS afero.Fs
Files []*ManifestFile
}
func NewFromPath(inputPath string) (*Manifest, error) {
afs := afero.NewBasePathFs(afero.NewOsFs(), inputPath)
return NewFromFilesystem(afs)
}
func NewFromFilesystem(fs afero.Fs) (*Manifest, error) {
m := &Manifest{
SourceFS: fs,
}
m.Scan()
return m, nil
}
func (m *Manifest) Scan() {
afero.Walk(m.SourceFS, "", func(path string, info fs.FileInfo, err error) error {
nf := &ManifestFile{
Path: path,
FileInfo: info,
}
m.Files = append(m.Files, nf)
return nil
})
}
func (m *Manifest) Write(output io.Writer) error {
return nil
}