diff --git a/internal/types/id.go b/internal/types/id.go index 246ee80..3e32141 100644 --- a/internal/types/id.go +++ b/internal/types/id.go @@ -69,9 +69,15 @@ func (i ID) Parent() *ID { Key: strings.Join(parts[:len(parts)-2], "/") + "/", } } else { + dir := filepath.Dir(i.Key) + + if dir != "/" { + dir += "/" + } + parent = &ID{ Bucket: i.Bucket, - Key: filepath.Dir(i.Key) + "/", + Key: dir, } }