diff --git a/internal/types/id.go b/internal/types/id.go index ca1d006..246ee80 100644 --- a/internal/types/id.go +++ b/internal/types/id.go @@ -80,6 +80,11 @@ func (i ID) Parent() *ID { return parent } +// Name returns filename or directory name +func (i ID) Name() string { + return filepath.Base(i.Key) +} + // ParseID parses a string to an ID. Null if invalid func ParseID(id string) *ID { match := idRegex.FindStringSubmatch(id)