feat: implement configurable delete modes

This commit is contained in:
OpenClaw Agent
2026-09-21 13:38:18 +08:00
parent 633c833d1c
commit add2a22416
7 changed files with 102 additions and 5 deletions
+25
View File
@@ -91,6 +91,31 @@ func (m Multi) Remove(p string) error {
}
return r.Remove(rel)
}
func (m Multi) Trash(p string) error {
r, rel, ok := m.find(p)
if !ok {
return os.ErrNotExist
}
return r.Trash(rel)
}
func (m Multi) MoveToTrash(p, trashRoot string) error {
r, rel, ok := m.find(p)
if !ok {
return os.ErrNotExist
}
return r.MoveToTrash(rel, filepath.Join(trashRoot, m.RootName(r)))
}
func (m Multi) RootName(r Local) string {
for i := range m.Roots {
if m.Roots[i].Root == r.Root {
return m.Names[i]
}
}
return "root"
}
func (m Multi) Rename(a, b string) error {
ra, aa, oka := m.find(a)
rb, bb, okb := m.find(b)