From aa07feeac017d48286815e11bdb0c62d4f29c1a0 Mon Sep 17 00:00:00 2001 From: Richard Sanger Date: Sat, 11 Jan 2020 17:25:21 +1300 Subject: [PATCH] Fix bug in gcd: init fails to create directories init would not create directories in the root of a drive as it did not know the root drive's ID. --- src/duplicacy_gcdstorage.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/duplicacy_gcdstorage.go b/src/duplicacy_gcdstorage.go index c04aff2..4eb0215 100644 --- a/src/duplicacy_gcdstorage.go +++ b/src/duplicacy_gcdstorage.go @@ -264,11 +264,6 @@ func (storage *GCDStorage) getIDFromPath(threadIndex int, filePath string, creat fileID = rootID } - // Write directly to the root of the drive - if filePath == "" { - return fileID, nil - } - names := strings.Split(filePath, "/") current := "" for i, name := range names { @@ -361,6 +356,7 @@ func CreateGCDStorage(tokenFile string, driveID string, storagePath string, thre storage.attempts[i] = 0 } + storage.savePathID("", driveID) storagePathID, err := storage.getIDFromPath(0, storagePath, true) if err != nil { return nil, err