mirror of
https://github.com/rclone/rclone.git
synced 2025-08-13 23:38:51 +02:00
fs: Document that Purger returns error on empty directory, test and fix
This commit is contained in:
@ -161,9 +161,12 @@ func RandomRemote(remoteName string, subdir bool) (fs.Fs, func()) {
|
||||
}
|
||||
|
||||
finalise := func() {
|
||||
TestPurge(remote)
|
||||
_ = fs.Purge(remote) // ignore error
|
||||
if parentRemote != nil {
|
||||
TestPurge(parentRemote)
|
||||
err = fs.Purge(parentRemote) // ignore error
|
||||
if err != nil {
|
||||
log.Printf("Failed to purge %v: %v", parentRemote, err)
|
||||
}
|
||||
}
|
||||
// Delete directory if we made one above
|
||||
if rmdir != "" {
|
||||
|
Reference in New Issue
Block a user