mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-06 00:03:38 +00:00
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.
This commit is contained in:
@@ -264,11 +264,6 @@ func (storage *GCDStorage) getIDFromPath(threadIndex int, filePath string, creat
|
|||||||
fileID = rootID
|
fileID = rootID
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write directly to the root of the drive
|
|
||||||
if filePath == "" {
|
|
||||||
return fileID, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
names := strings.Split(filePath, "/")
|
names := strings.Split(filePath, "/")
|
||||||
current := ""
|
current := ""
|
||||||
for i, name := range names {
|
for i, name := range names {
|
||||||
@@ -361,6 +356,7 @@ func CreateGCDStorage(tokenFile string, driveID string, storagePath string, thre
|
|||||||
storage.attempts[i] = 0
|
storage.attempts[i] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storage.savePathID("", driveID)
|
||||||
storagePathID, err := storage.getIDFromPath(0, storagePath, true)
|
storagePathID, err := storage.getIDFromPath(0, storagePath, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user