forked from TrueCloudLab/rclone
rclone: Don't purge if --dry-run set
This commit is contained in:
parent
e055ed0489
commit
eb2b4ea8aa
1 changed files with 8 additions and 4 deletions
|
@ -475,10 +475,14 @@ func Rmdir(f Fs) error {
|
|||
// FIXME doesn't delete local directories
|
||||
func Purge(f Fs) error {
|
||||
if purger, ok := f.(Purger); ok {
|
||||
err := purger.Purge()
|
||||
if err != nil {
|
||||
Stats.Error()
|
||||
return err
|
||||
if Config.DryRun {
|
||||
Debug(f, "Not purging as --dry-run set")
|
||||
} else {
|
||||
err := purger.Purge()
|
||||
if err != nil {
|
||||
Stats.Error()
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DeleteFiles(f.List())
|
||||
|
|
Loading…
Reference in a new issue