From c55402caa2167b7ed8c6cd2d367033aa88eccc14 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 9 Dec 2016 16:45:11 +0000 Subject: [PATCH] drive: create destination directory on Move() --- drive/drive.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drive/drive.go b/drive/drive.go index ec4b57d94..711a20cae 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -735,6 +735,12 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) { return nil, errors.New("can't move a Google document") } + // create the destination directory if necessary + err := f.dirCache.FindRoot(true) + if err != nil { + return nil, err + } + // Temporary Object under construction dstObj, dstInfo, err := f.createFileInfo(remote, srcObj.ModTime(), srcObj.bytes) if err != nil {