mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 15:30:06 +08:00
drive: Add error for purge with --drive-trashed-only - fixes #3407
Purge should not be used with --drive-trashed-only flag as it leads to unexpected behavior. After this commit if TrashedOnly option is set to true, error message is returned. See also: https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/14
This commit is contained in:
parent
23a0332185
commit
1e7bc359be
|
@ -1941,6 +1941,9 @@ func (f *Fs) Purge(ctx context.Context) error {
|
|||
if f.root == "" {
|
||||
return errors.New("can't purge root directory")
|
||||
}
|
||||
if f.opt.TrashedOnly {
|
||||
return errors.New("Can't purge with --drive-trashed-only. Use delete if you want to selectively delete files")
|
||||
}
|
||||
err := f.dirCache.FindRoot(ctx, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user