1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-23 21:44:49 +02:00

fs: Document that Purger returns error on empty directory, test and fix

This commit is contained in:
Nick Craig-Wood
2014-07-28 21:02:00 +01:00
parent 9711a5d647
commit 2f9f9afac2
4 changed files with 19 additions and 4 deletions

View File

@@ -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 != "" {