feat(alias): support Rename and Remove (#6478)

* feat(alias): support `Rename` and `Remove`

* fix(alias): `autoFlatten` not updated after editing

* feat(alias): add `protect_same_name` option
This commit is contained in:
j2rong4cn
2024-05-22 09:27:48 +08:00
committed by GitHub
parent bbe3d4e19f
commit 037850bbd5
4 changed files with 70 additions and 2 deletions

View File

@ -9,7 +9,8 @@ type Addition struct {
// Usually one of two
// driver.RootPath
// define other
Paths string `json:"paths" required:"true" type:"text"`
Paths string `json:"paths" required:"true" type:"text"`
ProtectSameName bool `json:"protect_same_name" default:"true" required:"false" help:"Protects same-name files from Delete or Rename"`
}
var config = driver.Config{
@ -22,6 +23,10 @@ var config = driver.Config{
func init() {
op.RegisterDriver(func() driver.Driver {
return &Alias{}
return &Alias{
Addition: Addition{
ProtectSameName: true,
},
}
})
}