mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-01 05:28:30 +00:00
*: close to producing a validating hierarchy
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
ecdf381dd9
commit
d1ddeb8e3d
4 changed files with 200 additions and 18 deletions
11
hierarchy.go
11
hierarchy.go
|
@ -46,8 +46,17 @@ func (e Entry) String() string {
|
|||
if e.Raw != "" {
|
||||
return e.Raw
|
||||
}
|
||||
if e.Type == BlankType {
|
||||
return ""
|
||||
}
|
||||
if e.Type == DotDotType {
|
||||
return e.Name
|
||||
}
|
||||
// TODO(vbatts) if type is RelativeType and a keyword of not type=dir
|
||||
return fmt.Sprintf("%s %s", e.Name, strings.Join(e.Keywords, " "))
|
||||
if e.Type == SpecialType || e.Type == FullType || inSlice("type=dir", e.Keywords) {
|
||||
return fmt.Sprintf("%s %s", e.Name, strings.Join(e.Keywords, " "))
|
||||
}
|
||||
return fmt.Sprintf(" %s %s", e.Name, strings.Join(e.Keywords, " "))
|
||||
}
|
||||
|
||||
// EntryType are the formats of lines in an mtree spec file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue