aboutsummaryrefslogtreecommitdiffhomepage
path: root/ldd/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'ldd/path.go')
-rw-r--r--ldd/path.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/ldd/path.go b/ldd/path.go
index 4e41ce74..a0cdb120 100644
--- a/ldd/path.go
+++ b/ldd/path.go
@@ -1,21 +1,20 @@
package ldd
import (
- "path"
- "slices"
+ "hakurei.app/container"
)
// Path returns a deterministic, deduplicated slice of absolute directory paths in entries.
-func Path(entries []*Entry) []string {
- p := make([]string, 0, len(entries)*2)
+func Path(entries []*Entry) []*container.Absolute {
+ p := make([]*container.Absolute, 0, len(entries)*2)
for _, entry := range entries {
- if path.IsAbs(entry.Path) {
- p = append(p, path.Dir(entry.Path))
+ if a, err := container.NewAbs(entry.Path); err == nil {
+ p = append(p, a.Dir())
}
- if path.IsAbs(entry.Name) {
- p = append(p, path.Dir(entry.Name))
+ if a, err := container.NewAbs(entry.Name); err == nil {
+ p = append(p, a.Dir())
}
}
- slices.Sort(p)
- return slices.Compact(p)
+ container.SortAbs(p)
+ return container.CompactAbs(p)
}