This commit is contained in:
Bel LaPointe
2021-03-28 13:12:15 -05:00
commit be2a031834
46 changed files with 11740 additions and 0 deletions

31
rclone/del.go Executable file
View File

@@ -0,0 +1,31 @@
package rclone
import (
"local/logb"
"local/sandbox/arlo-cleaner/config"
"path"
_ "github.com/ncw/rclone/backend/drive"
_ "github.com/ncw/rclone/backend/local"
_ "github.com/ncw/rclone/backend/s3"
"github.com/ncw/rclone/fs"
)
func (rc *RClone) Del(destination string) error {
f, err := fs.NewFs(path.Dir(destination))
if err != nil {
return err
}
obj, err := f.NewObject(path.Base(destination))
if err == fs.ErrorObjectNotFound {
return nil
} else if err != nil {
return err
}
if config.DryRun {
logb.Infof("del", obj)
//return nil TODO
}
logb.Infof("removing %v", destination)
return obj.Remove()
}