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
|
// FIXME doesn't delete local directories
|
||||||
func Purge(f Fs) error {
|
func Purge(f Fs) error {
|
||||||
if purger, ok := f.(Purger); ok {
|
if purger, ok := f.(Purger); ok {
|
||||||
err := purger.Purge()
|
if Config.DryRun {
|
||||||
if err != nil {
|
Debug(f, "Not purging as --dry-run set")
|
||||||
Stats.Error()
|
} else {
|
||||||
return err
|
err := purger.Purge()
|
||||||
|
if err != nil {
|
||||||
|
Stats.Error()
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DeleteFiles(f.List())
|
DeleteFiles(f.List())
|
||||||
|
|
Loading…
Reference in a new issue