Answer architecture round 10: the paired ruling at fb2c809 is better; a mounted module names its manifest from its files' root, and the mount wrapper returns nothing beside an error
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -49,7 +50,12 @@ func (s Source) Manifest() (Manifest, error) {
|
||||
}
|
||||
|
||||
// ManifestPath is the manifest's path as errors name it.
|
||||
func (s Source) ManifestPath() string { return s.labelled(ManifestFile) }
|
||||
func (s Source) ManifestPath() string {
|
||||
if m, isMounted := s.fsys.(mounted); isMounted {
|
||||
return s.labelled(path.Join(m.at, ManifestFile))
|
||||
}
|
||||
return s.labelled(ManifestFile)
|
||||
}
|
||||
|
||||
// decodeManifest decodes a manifest, refusing any key or shape it does not define, and
|
||||
// reports every mistake: first each entry's own, in path order, then each parent naming
|
||||
|
||||
Reference in New Issue
Block a user